Questions tagged as 'c#'

1
answer

Correct method to get ComboBox value populated by DataTable

What is the correct way to get the value of a ComboBox populated by a DataTable ? I'm using the following code: private void ComboBox3_SelectedIndexChanged(object sender, EventArgs e) { Consulta_cidade cidade = new Consulta...
asked by 22.07.2016 / 01:59
1
answer

Error while trying to set the MissingSchemaAction property of NpgsqlDataAdapter [closed]

I'm trying to set the MissingSchemaAction property of a NpgsqlDataAdapter object, but Visual Studio is complaining that the property does not exist. I looked at the github project and saw that NpgsqlDataAdapter inherits...
asked by 03.06.2016 / 00:32
1
answer

How does the BackgroundWorker e.error work?

I'm creating an application that makes multiple connections simultaneously. For each connection I create a TextBox and a BackgroundWorker . When I run DoWork of BackgroundWorker I use several ProgressPercentage...
asked by 28.11.2016 / 17:27
1
answer

The process can not access the file because it is being used by another process [closed]

The problem appears in the penultimate line of the code below, what can I do? Note: I've already tried using StreamReader, but it did not work. string CJ; string CJ1; string CJ2; StreamReader LJ = new StreamRead...
asked by 28.11.2016 / 03:33
3
answers

Avoid duplicate data in list

I need a list of musicians without repetitions, but it is bringing duplicate values, according to the amount of songs that each Musician has, how do I bring just one Musician? public ActionResult SelecaoMusico() { List<Musico> musico...
asked by 22.11.2016 / 04:16
3
answers

Remove line from an array

How do I remove the line without getting whitespace? N7 G90 N8 G26 RA 10.840 N9 G54 G92 X115.00 Y25.00 N11 C5 N12 D14 N13 G42 G01 X76.3276 Y-19.86 Having to look like this: N7 G90 N8 G26 RA 10.840 N9 G54 G92 X115.00 Y25.00 N11 C5 N12 D1...
asked by 17.10.2016 / 14:18
2
answers

Calling an AccountController function

I'm trying to fetch the logged-in user ID like this: public int CurrentUserID() { return Convert.ToInt32(User.Identity.GetUserId()); } This method is in AccountController and I want to call it from any other controlle...
asked by 14.12.2016 / 14:21
3
answers

Avoid editing in the field

I am trying to do the following: the user types his / her zip, and then it is populated automatically, estado (select) cidade (select), rua (input) and bairro (input), when the user types his / her zip and for example...
asked by 16.12.2016 / 13:40
3
answers

Compare string with enum, within lambda?

The problem is: I have a dropdownlist loaded from an enum, which may come with the null value of the screen. listaItensSolicitados = os.Site == null ? this.itemSolicitadoService.Consultar(o => o.ItemServico.Servico.Chave...
asked by 09.12.2016 / 15:53
1
answer

What is the reference for HttpContext.GetOwinContext ()?

I needed to abstract the Controllers of an application ASP.NET MVC to a Class Library because I'm using different technologies in the same application. However, I have the error:    'System.Web.HttpContextBase' does no...
asked by 12.12.2016 / 21:06