Gridview - Tips On Populating Gridview (Examples in C# and VB - NET)
Gridview - Tips On Populating Gridview (Examples in C# and VB - NET)
In this short snippet, we will populate a DataGridView using the LoadData() method. This
method uses the SqlDataAdapter to populate a DataSet. The table ‘Orders’ in the DataSet is
then bound to the BindingSource component which gives us the flexibility to choose/modify
the data location.
C#
}
VB.NET
Tip 2 – Update the data in the DataGridView and save changes in the
database
After editing the data in the cells, if you would like to update the changes permanently in
the database, use the following code:
C#
VB.NET
C#
VB.NET
C#
VB.NET
C#
C#
C#
Tip 9 - Change the Color of Cells, Rows and Border in the DataGridView
C#
VB.NET
C#
VB.NET
C#
}
VB.NET
VB.NET
C#
VB.NET
C#
VB.NET