In this sample we have used the VB.Net code for binding the data to the ASP.Net GridView control. The Northwind SQL database has been used to display the categoryId, categoryName and description retrieved from the categories table. In the VB.Net code for Gridview databinding we have used the following class objects to specify the data source using connectionstring, sql command to fetch the required data and a dataset to store the retrieved records.
DataBinding Elements Used
1. SqlConnection
2. SqlCommand
3. SqlAdapter
4. DataSet
See the sample below to understand the output of the VB.Net GridView Databinding code: