Questions tagged as 'c#'

3
answers

How do I avoid writing in a textbox in c #?

What I want to do is that when I reach the limit of 10 characters that the user wrote on my little system I made an error and I did not write anymore, but what happens is that it only marks the error but every time I enter a new one number recei...
asked by 28.09.2016 / 21:07
2
answers

How can I use the data I get from a texbox in the whole form?

How can I occupy the data I get from a texbox in the whole form if I have to repeat the declaration of a variable in each event of different buttons in C #, for example I have two buttons, but I do not want to declare the variable twice name, ho...
asked by 15.01.2018 / 18:29
3
answers

I am trying to change from IlistEmployee to listEmployee

I'm trying to move from Ilist to list and then display it in a DataGridView but I get an error ... it tells me that it is not possible to implicitly convert List<Empleado> lista = new List<Empleado>(); lista = servicio.Consultar();...
asked by 27.11.2017 / 02:34
5
answers

Visual C # - Open form already created, Windows Forms

I have the initial form called "start", and a button called "run". Now I have created an additional form called "runf". How can I open "runf" from the "run" button. I have tried to look on the internet, and the answer is the following .. Form...
asked by 07.07.2016 / 01:14
3
answers

ASP .Net Core 2.0 - Reading appsettings.json from a non-parameterized class

I'm starting with an asp.net core 2.0 mvc web and I can not read directly from a class the value of the appsettings.json (ConnectionString) that I need. I've found a lot of documentation, although none of them gets what I want. Summing up all...
asked by 27.03.2018 / 22:28
1
answer

How to define a list of many elements

I'm trying to define a list of a lot of elements, so many elements that it does not even compile me. long longitud = 100000; List<int> lista = new List<int>(longitud); The problem is that it says that it can not...
asked by 08.06.2018 / 12:07
2
answers

How to make a Regex pattern in C # with the character '@'?

Good, I want to make a Pattern Regex to verify that in a chain there is the arroba character in the middle of two text strings in C #, the conventional: [email protected]. if (Regex.IsMatch(email, "\@{1,1}")) { //Codigo } In t...
asked by 28.09.2017 / 15:32
1
answer

Use of the local variable not assigned

I execute the following method: static bool elimino(int[] lista, string[] nombre, string nom, ref int tope) { Console.Write("Nombre"); nom = Console.ReadLine() bool e = false; for (int i = 0; i < tope;...
asked by 29.06.2017 / 19:05
2
answers

Search major number of a List c #

Good Night, I have to get the biggest number on a list and I do not know how to get it, I'm using 2 for to get it but I keep the last major I can not get it. This is my code: static int get(int[] a) { int sort = 0; int s...
asked by 09.09.2017 / 04:29
1
answer

I have a problem when I give my button Save or Insert my form, since it does not save me or present me with any error, I do not know what to do

This in the Order that I'm giving to my save button, so that I save the data in my database called Patient. I can not find which is the reason, when I click on the button it does not do anything to me, it's as if I did not receive the order. u...
asked by 17.08.2017 / 17:16