Displaying database query data in the form of a table

I am a little new to C #. I am working on a database application and I need to execute a query, say SELECT, and load it into some kind of table. Then I want to double-click on the result and load it into my original data entry form. Can someone tell me how I should follow? Do not waste time adding coding, etc. Just steps will be enough. A link to a good resource will also be OK :)

+3
source share
4 answers

See SqlCommand , SqlDataAdapter, and DataTable for retrieving data from a database. Assuming an SQL server, otherwise other database providers are also available and implement the same API.

For Window Forms, look at a DataGridView , you can bind a DataTable to it and display the data in a DataTable

Here you can find an example.

+4
source

Loot in some samples:

Future readings:

  • @MSDN data access application block
  • (LinqToSQL, Entity Framework, NHibernate ..)
+1

ADO.NET

: ADO.NET - , , , . .NET. Framework . API ADO.NET , .NET. Framework, Visual Basic, #, J # Visual ++.

0

Source: https://habr.com/ru/post/1716962/


All Articles