Questions tagged as 'c#'

2
answers

Identify a third in a decimal number

How can I identify a third of a decimal number with 5 digits after the period. in c #. Ex. If we have: 0.15171 = if it is third From (1) 0.17902 = is not tercia. 0.79277 = if it is tertiary.De (7)     
asked by 21.09.2017 / 17:37
1
answer

Can an attribute in a static class and the name of a parameter be called equal?

I try to do the following; class StringRotation { private static char[] Primera = new char[256]; private static char[] segunda = new char[256]; public static int ShiftedDiff(string primera, string...
asked by 23.08.2017 / 10:57
2
answers

how to add the diagonal from right to left in a matrix

Good evening, I managed to add the left-right diagonal, that is, from position 0,0, but I have not managed to add the diagonal from right to left in an example of a 3 x 3 matrix. The code that I am going to show it's just the sum of the diagona...
asked by 24.08.2017 / 02:26
1
answer

How can I capture a number by keyboard and take it to a float type variable?

Good morning, I understand that when I capture a data by keyboard I should convert it like this: entero1 = Convert.ToInt32(Console.ReadLine()) Now my question is how can I do it if the data I need is decimal, I try it this way, but the synt...
asked by 28.08.2017 / 08:46
5
answers

How do I convert an int to a string? [duplicate]

I want to convert a value of type int to a string to show it in a textbox as it would be the correct way to do it.     
asked by 26.09.2017 / 03:22
1
answer

Error executing SaveChanges ()

I'm doing a ActionResult that helps me to do a update and to do a insert , depending on the flag that passes as a parameter, this I had already done with other controllers and it works perfectly, but with this it sends an err...
asked by 24.07.2017 / 18:50
2
answers

Send variables to SP with foreach

I have a method that reads from a table (X) 3 values and sends them to a StoreProceduces as many times as records have the table (x) so what I do is the following: foreach (var item in resultado) { cmd.Parameters...
asked by 14.08.2017 / 16:49
2
answers

I have this error: error you have an error in your sql syntax check the

I was configuring one of my form where I was adding the button to find the one when I indicated an ID I would upload the patient data to all my texbox, when making the code and when executing it, everything was fine until the moment when I wante...
asked by 14.08.2017 / 23:18
1
answer

Export DataGridView headers

Through a datagridview I generate a TXT file where it only throws me the results How to export headers? TextWriter writer = new StreamWriter(@"C:\test\guest.txt"); for (int i = 0; i < dataGridView2.Rows.Count -1 ; i++)...
asked by 04.08.2017 / 00:06
1
answer

Why does not OnClick work on my td? [closed]

I have the following code in jquery , which adds a row to a table var fila = "<tr><td>" + $.trim(idProduct) + "</td>"; fila += "<td>" + $.trim(response.d.nombreProducto) + "</td>"; fila += "<td onclick='O...
asked by 12.07.2017 / 22:28