Questions tagged as 'ado.net'

1
answer

How to update a datagridview automatically?

I've created an application that will display the data of a given view in a datagridview control. The whole application is ready: loading the data, the button to update and also the events load and activated . Technologie...
asked by 24.05.2016 / 22:24
4
answers

Changing app.config connectionStrings physically in runtime

In my app.config I have the following lines of code: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> </configSections> <connectionStrings> <add name="ControleBD"...
asked by 22.07.2014 / 16:26
1
answer

What is the best way to set up a query?

What is the best way to set up a query in C #? Is it advisable to use concatenation with the + operator? For example: query += " WHERE nome LIKE '%" + nome + "%'"; Here is a% w of% that I set as an example to illustrate the situat...
asked by 18.12.2015 / 00:24
3
answers

Find string in more than one SQL table

I would like to fetch a given string using LIKE in more than 1 table. Here is an example of how I did it, which will probably spend a lot of time or not fetch all tables: string SQL1 = @"SELECT * FROM TB_1 WHERE NOME LIKE '%' +...
asked by 06.03.2014 / 19:37
2
answers

What is the best place to store the connection string? [closed]

There are a few possible places to store the string connection. Leave tied inside code, app.config , configuration file and Windows registry. What is the best place to store the string connection? Based on the requirements, security...
asked by 02.06.2016 / 15:41
1
answer

Parameterizing DataSet in C #

I created a search screen with textbox , button and gridview . I would like the search results to appear in this Gridview but I can only do this with a Dataset . In this case, I needed to find a way to pass parame...
asked by 19.06.2016 / 18:32
1
answer

Parameter for unidentified Stored Procedure

I'm having a problem, which would be a mistake saying that there is no parameter being passed to the procedure . It is running the following code: cmdProcedure.Parameters.AddWithValue("@id", 0); Command: public List<Models.Admin>...
asked by 18.02.2014 / 18:10
2
answers

Difference between ADO.NET and Dapper

What are the differences between the ORM's? When to use one and when to use the other? What are the disadvantages of each?     
asked by 19.07.2018 / 02:32
2
answers

Return DataReader to field type bool

I need to return a field that is of type bool : public List<TB_USUARIO> ListarTodos() { var strQuery = "select * from tb_usuario"; using (contexto = new Contexto()) { var retornoDataRead...
asked by 11.05.2016 / 17:36
1
answer

What are the differences between a DataTable and a DataReader for MySQL queries in C #?

I am creating a C # project with MySQL, my connector follows the Singleton pattern and I use MySqlDataReader to retrieve the data from the table and popular a List so far so good. My problem started when I had to recover data from one table b...
asked by 26.01.2015 / 20:58