Binding Controls to a Dataset
A DataSet can be used with an ASP.NET page, using the Repeater, DataList, and DataGrid controls in exactly the same way as with a DataReader.
The following example, displays the contents of the Employees database table in a DataGrid control.
The output of above example is shown below:
It is seen the the DataGrid control is bound to the Products database table with the following two lines of codes:
dgrdEmployees.DataSource = dstEmployees
The first statement assigns the first table in the DataSet to the DataGrid control's DataSource property.
The second statement actually binds the data from the DataSet to the DataGrid control, populating the DataGrid with the items from the DataSet.
The DataTable is a central object in the ADO.NET library. Other objects that use the DataTable are the DataSet and the DataView.
When DataTable objects are accessed, note that they are conditionally case-sensitive. For example, if one DataTable is named "mydatatable" and another is named "Mydatatable", a string used, to search for one of the tables is regarded as case-sensitive. However, if "mydatatable" exists and "Mydatatable" does not, the search string is regarded as case-insensitive.
A DataTable is a memory-resident representation of a database table in a DataSet.