Tag Archives: DataTable

Update a DataTable that is bound to a DataGridView in C#

The example Build a DataTable and bind it to a DataGridView in C# shows how you can bind a DataTable to a DataGridView to display data. This example shows how you can add new data to the display. When the … Continue reading

Posted in controls, database | Tagged , , , , , , , , , , , | Leave a comment

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

Handle DataGridView errors in C#

This example shows how you can handle DataGridView errors when you modify the data in the DataGridView control. The example Build a DataTable and bind it to a DataGridView in C# shows how to use a DataGridView control to display … Continue reading

Posted in controls, database | Tagged , , , , , , , , , , , , , , | 1 Comment

Build a DataTable and bind it to a DataGridView in C#

This example shows how you can build a DataTable and bind it to a DataGridView control. A DataTable is an in-memory representation of a relational database table. It can define columns of particular data types and even enforce uniqueness and … Continue reading

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