Tag Archives: binding

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

Bind arrays and lists in C#

One way to display the items in an array in a ListBox is to loop through the items and add them to the ListBox one at a time, but there’s an easier way. You can bind arrays to a ListBox … Continue reading

Posted in arrays, controls, lists | Tagged , , , , , , , , , , , , | 2 Comments

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

Rotate a 3D cube using XAML and C#

This example shows how to display and rotate a 3D cube using XAML. It displays a blue three-dimensional cube with scroll bars that you can use to rotate the cube to view it from different directions. The following shows the … Continue reading

Posted in graphics, wpf, XAML | Tagged , , , , , , , , , , , , , , , , , , | 9 Comments