Questions tagged as '.net'

1
answer

ConnectionStrings: Write in app.config or windows registry?

My question is the best way to keep ConnectionString of my system on disk to be read as needed, ie what is the best way to do this by writing it to the file app.config , or writing to record of Windows ? What are the a...
asked by 24.01.2017 / 23:32
1
answer

How to set the Index of a List to start at 1 instead of 0 when populated

Whenever I populate a list in C #, as in the example below, as I add items, they are arranged starting from position 0 in index . If I add 5 items to my list, I will have 0, 1, 2, 3, and 4 positions. I need to make index start with 1 and get i...
asked by 26.10.2018 / 00:43
2
answers

Randomly generated list

I want to generate a list of cars with random characteristics of brand, model, color and year. These values are stored in a car list. The problem is that at the time of doing the loop that calls the gerarCarro() function, which adds ran...
asked by 04.08.2017 / 02:07
1
answer

Is it necessary to pay anything to use asp.net?

I've heard that .NEt is not free and that I have to pay for Microsoft if I publish a .NET application. Is this true? If I want to install the technology on a web page server will I have to pay something?     
asked by 05.03.2018 / 13:26
2
answers

Can you simplify this amount of conditions?

I have the following code: foreach (var lote in collection.ToList()) { count++; ushort[] dadosBalanca = new ushort[9]; if (lote.AlvoPasso > ushort.MaxValue) {...
asked by 19.02.2018 / 16:27
2
answers

at and followed quotation marks in a string (exiting & quot; or # 39; in View)

I'm trying to put the following text in a string, but I can not ... when there is no error in the double quotation marks of the at ... to getting crazy. Can anyone help me?   , {       "@type": "ListItem",       "position": 2,       "item": {...
asked by 08.05.2018 / 19:48
3
answers

Error while passing SqlParameter

I have a method to return a query , but it is giving error. Class Data.cs: public static SqlDataReader retornaQuery(SqlCommand query, List<SqlParameter> parameters) { try { //Instância...
asked by 08.08.2014 / 18:08
2
answers

Find out if it is even or odd in array

I'm trying to set the even and odd numbers of a total of 5 numbers entered by the user into a vector. int[] atividade = new int[6]; for (int i = 1; i < 6; i++) { Console.WriteLine("Insira o " + i + "° num...
asked by 20.08.2017 / 04:37
2
answers

Error executing program using "args"

I'm trying to run a program by passing some values as partions on the command line but it is returning the error below. C:\Users\joao.mello\Documents\C#> .\exercicio32.exe 5 1 0 4 9 32 4    Unhandled Exception: System.IndexOutOfRangeExce...
asked by 05.02.2017 / 23:13
3
answers

Check If DataGridView field of type DataGridViewCheckBoxColumn is checked

I have a dataGridView and I check to see if the column of type DataGridViewCheckBoxColumn has any selected row. If there is at least one line with this field selected I execute an action type, otherwise I will trigger a message of type Messabox....
asked by 06.10.2017 / 23:50