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 :)
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
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++.
Loot at some samples:
- Database Viewer (in sources) http://www.codeproject.com/KB/database/MyDbViewerSite.aspx
- Also look at this http-support.microsoft.com/kb/308247
Future Readings:
- Data Access Application Block @MSDN
- Various Object Relational Mappers (LinqToSQL, Entity Framework, NHibernate etc)