Questions tagged as 'c#'

1
answer

BackgroundWorker or Async

I need to develop a C # program where I will have slow processes. I have little experience with WinForms, I have more experience with WEB development. With the following question, does the BackgroudWorker component do the same thing as cal...
asked by 27.07.2016 / 13:43
1
answer

When instantiating the ICollection

I'm reviewing some programming approaches and fall into a dilemma as to where we should instantiate our navigation properties from EF ICollection . Many cases I see that the personnel instantiates them in the constructor, would t...
asked by 26.07.2016 / 04:09
2
answers

How to leave the selected line font in bold in DataGridView?

In the DataGridView of Windows Forms it is possible to change the font color and background color of the selected row easily using the DataGridView.DefaultCellStyle.SelectionBackColor DataGridView.DefaultCellStyle.SelectionForeColor But wha...
asked by 12.07.2016 / 19:13
1
answer

How to use areas only using the root controller

I created an ASP.NET MVC 5 project where I had made a template , so now we will have several templates divided by areas . But the controllers will be the same, so I did not want to create the same controllers for all areas . How do I do...
asked by 27.08.2016 / 04:08
1
answer

Differences between XmlReader, StreamReader and StringReader in deserialization

I asked the following question here in stackoverflow link question . During the deserialization, depending on the stream you use, an error can occur in the XML namespaces, depending on the question link. Examples of the code that has the...
asked by 19.08.2016 / 15:49
1
answer

How to do select using LINQ with 2 tables? [closed]

Thisismyselect:bd=newAcessoBancoDados();bd.Conectar();stringcidade="SELECT c.Nome FROM Cidade c join Estado e on c.EstadoId = e.EstadoId WHERE e.Sigla = '" + dto.Estado + "'"; dt = bd.RetornDataTable(cidade); That in the register I selec...
asked by 20.08.2016 / 01:33
2
answers

Convert an IPAddress to string

This code gets the default gateway , but I can not convert the result to string and put it in a label . public static IPAddress GetDefaultGateway() { var card = NetworkInterface.GetAllNetworkInterfaces().FirstOrDefault(); if(c...
asked by 24.06.2016 / 02:24
1
answer

How to work with more than one dropdownlist to mount a C # URL?

I have the following dropdownlist where in the first one the person chooses whether he wants rental or sale. Thequeryinthedatabaseisbeingdoneasfollows:publicList<Imovel>ObterCasaOperacao(stringcodigoOperacao){try{stringsql="SELECT i.Co...
asked by 22.08.2016 / 19:16
2
answers

Square root C #

Good, After the user tips I decided to improve my C # code on the calculator. I think it is simpler but I have a small problem in Square Root because I try to make the count and the result always gives me 0. private void btn_raiz_Click(obj...
asked by 23.06.2016 / 17:42
2
answers

How to pass an IEnumerable Model to a Controller?

I have a page that correctly lists my records. But I have Html.BeginForm for each line, @model IEnumerable<Generico.Dominio.TB_POSSIBILIDADE> @{ ViewBag.Title = ""; } @if (Model.Count() > 0)...
asked by 28.07.2016 / 18:20