Questions tagged as 'c#'

2
answers

MySQL DATE type is shown as DATETIME in a datagrid

I create a very simple database with the following command: CREATE TABLE IF NOT EXISTS 'ABC'.'Socio' ( 'idSocio' INT NOT NULL, 'SocioNome' VARCHAR(45) NULL, 'SocioDataNasc' DATE NULL, PRIMARY KEY ('idSocio')) ENGINE = InnoD...
asked by 09.11.2016 / 22:31
1
answer

Field calculated with EF

I have two classes: public class Cliente { public int Id {get;set; public string Nome { get; set; } public string Email { get; set; } public string Telefone { get; set; } public string Celular { get; set; }...
asked by 29.11.2016 / 19:24
3
answers

Group repeating sql fill statement values from DropDownList

I'm getting information from a table and filling a DropDownList , but I have a lot of information repeated and would like to group the values so they do not repeat in DropDownList . Example information I'm capturing. Cidade1 Ci...
asked by 10.10.2017 / 20:33
2
answers

Parameter automation Mysql does not work

I'm trying to create a way to automate the business of adding parameters in the query to prevent sql inject, but it does not work! Here's my code: public static MySqlCommand criarQueryComParametros(string tabela, string condicao) { List...
asked by 17.10.2017 / 01:37
1
answer

arterySignalIr / Ping - What is causing this error?

The project MVC in C# here of the company has a very bizarre bug, to say the least. From time to time a random error pops up: The controller for path ... arterySignalIr / Ping was not found or does not implement IController, see...
asked by 12.01.2016 / 12:58
2
answers

How to get only the date, without the time, of a DateTime?

Converting a field using ToDateTime it brings the date and time. parcelamento.data_vencimento = Convert.ToDateTime(reader["data_vencimento"]); Is there any direct conversion to bring only the date without the time?     
asked by 03.01.2016 / 00:11
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
1
answer

get the values from a Listt generic list

My Winforms C # project has a form with a GridControl(gvDados) component and a Process button with a Click event . The validation happens in the Click event of the process button, through a method responsible for returning true if...
asked by 26.09.2018 / 19:10
2
answers

Property with private set

Is there a difference between declaring the set private or just omit it? public int UmaPropriedade {get; private set;} public int OutraPropriedade {get;} Are the two lines of code equivalent?     
asked by 03.02.2018 / 12:14
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