There are four core objects that make up each .NET data provider:
- Connections - for connecting to and managing operations against a database.
- Commands - for issuing SQL commands to execute against a database.
- DataReaders - for directly reading data off a stream.
- DataSets and DataAdapters - for storing and manipulating data in a memory-resident data store.
The following diagram illustrates the components of the ADO.NET architecture.
In brief, the core ADO.NET functionalities may be summarized as follows:
- A Connection object establishes the link between a Web page and a database.
- Once a link exists, different forms of Commands can be issued to the database provider. Commands may either act directly against the database, or return a result set for further processing.
- For fast, efficient display-only of data, the result set can be read by a DataReader.
- To enable users to work with the data, the result set can be stored into a memory-resident DataSet object, which are manipulated via DataAdapter objects. Using the built-in methods in the DataAdapter, changes in the DataSet can easily be reconciled with the underlying data source.
Displaying Information from a Database