Chathuranga Chandrasekara
Chathuranga Chandrasekara

Reputation: 20906

Displaying DB query data as a table

I am bit new to C#. I am working on a Database application and I need to execute a query say a SELECT and load it in to some sort of table view. Then I want to double click on a result and get it loaded to my original data entry form. Can someone tell me the way that I should follow? Dont waste your time to add coding etc. Simply the steps would be enough. A link to a good resource is also be OK :)

Upvotes: 3

Views: 621

Answers (4)

Yury Skaletskiy
Yury Skaletskiy

Reputation: 4241

Loot at some samples:

Future Readings:

  • Data Access Application Block @MSDN
  • Various Object Relational Mappers (LinqToSQL, Entity Framework, NHibernate etc)

Upvotes: 1

KV Prajapati
KV Prajapati

Reputation: 94645

ADO.NET

SUMMARY: ADO.NET is a data-access technology that enables applications to connect to data stores and manipulate data contained in them in various ways. It is based on the .NET Framework and it is highly integrated with the rest of the Framework class library. The ADO.NET API is designed so it can be used from all programming languages that target the .NET Framework, such as Visual Basic, C#, J# and Visual C++.

Upvotes: 0

Philip Fourie
Philip Fourie

Reputation: 116857

Have a look at SqlCommand, SqlDataAdapter and DataTable to retrieve data from the DB. Assuming SQL server, otherwise other DB providers are also available and implement the same API.

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

You can find an example over here

Upvotes: 4

Related Questions