Questions tagged as 'c#'

1
answer

Dependencies with EntityFramework C #

My question is how to use the state class include for parents because the city class has no parent connection. How can I accomplish this sql loading dependencies? private void FrmCidade_Load(object sender, EventArgs e) { var registros = Co...
asked by 15.09.2017 / 17:26
1
answer

TCP Connection Server (127.0.0.1) Why are you locking in this line?

I'm trying to create a chat with client and server in C #, but I'm having trouble in this line: client = servidor.AcceptTcpClient(); //Espera conexão I'll post my code here to see if any of you can figure out what error it's making it hangs...
asked by 17.09.2017 / 02:13
1
answer

Converting E MMM dd HH: mm: ss Z yyyy for dd / MM / yyyy HH: mm: ss c #

I am getting the following date Thu Sep 01 00:00:00 BRT 2016 and need to convert to dd/MM/yyyy HH:mm:ss Only convert generates error, I am receiving this date via string of a System. Can anyone help me? DateTime dtPe...
asked by 29.11.2017 / 15:55
2
answers

Save Image in VARBINARY with C # ASP.NET

How do I get an image received on a Form of HTML and write to the bank in VARBINARY with C# ? I'm using C# ASP.NET MVC5 CORE .     
asked by 30.11.2017 / 11:24
1
answer

A timer for a service to read a table in the DB

I need to have a service read a table in the DB every 5 or 10 seconds. I do not see any other way to do that. When this table changes a certain flag, then the service pushes a message to an App. I do not know if this is the best way to automate...
asked by 29.09.2017 / 20:44
1
answer

Add Action and Controller in BeginForm's HTMLHelper with T4

I need to add template and controller values to my T4 template, but I can not figure out how to pass the their names. Here's an example: CREATE.cs.t4 @using (Html.BeginForm("Create", "RamoAtividades", FormMethod.post, new {@class =...
asked by 06.09.2017 / 03:13
1
answer

Save image to database and give restore in database with PostgreSQL

What is the best way to save image to the PostgreSQL database? Currently I have an OID to save, I can use it normally, both to save and to recover, but when I go to restore in my database, the following error occurs pg_restore: [arquiva...
asked by 07.09.2017 / 15:59
1
answer

EntityFramework DatabaseGenerated

I have a property in my model where it automatically generates the Id when it is inserted in Db, but I have a specific case where I need to put the Id manually, is there any way to prevent EF from generating the automatic Id if I create and send...
asked by 12.09.2017 / 16:11
1
answer

I can not run an application in x86 debug mode

I'm having problems in my application, because when I compile in debug anycpu, it runs perfectly, but when I compile in x86 debug it has the following error:    System.BadImageFormatException: 'An attempt has been made to   load a program wit...
asked by 12.09.2017 / 16:28
2
answers

Error Object reference not set to an instance of an object in C # [closed]

I'm having trouble, when I register my route it appears an error in the time the system will make the comparison to see if the NumCarroId that is in the DropDownList is the same one that is in the bank so you can make the change. / p> Error ap...
asked by 04.09.2017 / 17:13