03-12-2012, 12:30 PM
The DataSet Class
ADO.docx (Size: 256.5 KB / Downloads: 31)
The data set represents a subset of the database. It does not have a continuous connection to the database. To update the database a reconnection is required. The DataSet contains DataTable objects and DataRelation objects. The DataRelation objects represent the relationship between two tables.
The DataAdapter Object:
The DataAdapter object acts as a mediator between the DataSet object and the database. This helps the data set to contain data from more than one database or other data source.
The DataReader Object:
The DataReader object is an alternative to the DataSet and DataAdapter combination. This object provides a connection oriented access to the data records in the database. These objects are suitable for read-only accesses, such as populating a list and then breaking the connection.
DbCommand and DbConnection Objects:
The DbConnection object represents a connection to the data source. The connection could be shared among different command objects.
The DbCommand object represents the command or a stored procedure sent to the database from retrieving or manipulating data.
Declarative Data Binding:
We have already used declarative data binding in the previous tutorial using GridView control. The other composite data bound controls capable of displaying and manipulating data in a tabular manner are the DetailsView, FormView and RecordList control.
In the next tutorial, we will look into the technology for handling database, i.e, ADO.Net.
However, the data binding involves the following objects:
• A dataset that stores the data retrieved from the database
• The data provider, which retrieves data from the database, using a command over a connection
• The data adapter that issues the select statement stored in the command object; it is also capable of update the data in a database by issuing Insert, Delete, and Update statements.