Questions tagged as '.net'

2
answers

Cut the last character of a C # string [duplicate]

I'm creating an export from SQL to TXT. With this I add the ";" after building each column. But at the end of the last column you are adding the ";" also. How do I get this ";" the end of the last column of all lines? My% of...
asked by 13.04.2016 / 20:51
2
answers

How to consume less memory in C # runtime?

What I would like to know is what are the most efficient ways to consume less memory in runtime . Using "static" variables? Create object with instances or a static class ? Using Dispose() to free memory, etc.     
asked by 21.06.2018 / 14:15
3
answers

Problem converting int to string

I'm trying to do a click counter in ASP.NET webforms and C #, and I need to convert the% number of clicks to a string in the label . But this does not work, the page is displayed but the number of clicks (the label ) does not appear. Code...
asked by 12.10.2015 / 22:39
2
answers

Define date and time format used by DateTime

I have an application where it has record time, which uses DateTime.Now , and a start date and end date that the user informs. Showing this data in a DataGrid is in MM/dd/yyyy hh:mm tt format. I want it to be shown in the Bra...
asked by 09.09.2015 / 18:35
2
answers

Dapper requires writing SQL code, why?

I'm looking at the following link using Dapper: Getting Started With PostgreSQL Using Dapper In .NET Core and my question is, when I do it through Java I do not need to write the SQL code as this example here: //1. Insert using (var conn =...
asked by 17.08.2018 / 22:06
2
answers

How do I get the first character of a String and make it uppercase by storing it in a variable?

String user,newUser,newPassword, password, resposta, user1,pass1; user = "admin"; password = "123"; Console.WriteLine("LOGIN\n"); body: Console.WriteLine("Ja possui login?"); resposta = Console...
asked by 06.09.2018 / 21:36
2
answers

Send parameters to a C #

I created a class called descricaoo that will receive some data parameters and will add in a List of an interface called IInstrucao . But it gives an error "the description class is not implemented to an interface" How to cor...
asked by 29.10.2015 / 16:33
1
answer

Var within FOR when it starts at 0 (zero) should Count be Count-1?

I picked up a system in the company where I work for another colleague. I note that all FOR's are like this: for(int i = 0; i < lista.count; i++) { //meu código } I learned that when a variable within FOR starts with zero, my COUNT...
asked by 12.03.2015 / 20:03
1
answer

How to print the name of the method, file and line that was called?

Example: filename: teste.cs Part of the code: ... public void MeuMetodo() { // suponha que essa linha seja a 100 Console.WriteLine("Arquivo: " + arquivo + "Metodo: " + metodo +" linha: " + linha); //Resultado seria:...
asked by 05.01.2018 / 12:14
1
answer

Save all types of variables in a vector / array?

How can I store values and variables of all types within a vector? Ex: vetor1.Add("valor em string"); vetor1.Add(100); vetor1.Add(100.10); vetor1.Add(-100); I have no idea how I can do this.     
asked by 04.02.2018 / 13:46