Tag Archives: DataSet

Use SQL queries to display master-detail data in C#

This example uses SQL queries to load master-detail data only when it is needed. For quite a while now, the .NET-ish way to manipulate data from a database has been to load it into a DataSet stored in memory and … Continue reading

Posted in ADO.NET, controls, database | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , | 4 Comments

Display master-detail data in a DataGrid in C#

At design time, I added the example’s Contacts.mdb database to the project, set its “Build Action” property to Content, and set its “Copy to Output Directory” property to “Copy if newer.” That way the database is copied into the executable … Continue reading

Posted in ADO.NET, controls, database | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , | 1 Comment

Bind a DataGrid to a DataSet holding multiple tables at runtime in C#

This example shows how you can bind a DataGrid control to a DataSet loaded from an MDB file at runtime. When the form loads, the following code builds the DataSet and binds it to the form’s DataGrid control. // The … Continue reading

Posted in controls, database | Tagged , , , , , , , , , , | 11 Comments