Data Access in ADO.NET relies on two components:DataSet and Data ProviderDataSet
The dataset is a disconnected storage and disconnected in-memory representation of data. It can be used as a local copy of the relevado.net portions of the database. The DataSet is persisted in memory and the data in it can be manipulated and updated independent of the database. When the use of this DataSet is finished, changes can be made back to the central database for updating. The data in DataSet can be loaded from any valid data source like Microsoft SQL server database, an Oracle database or from a Microsoft Access database.
The Data Provider is responsible for maintaining and providing the connection to the database. A DataProvider is a set of related components that work together to provide data in an efficient and performance driven manner. The .NET Framework currently comes with two DataProviders: the SQL Data Provider which is designed only to work with Microsoft's SQL Server 7.0 or later and the OleDb DataProvider which allows us to connect to other types of databases like Access and Oracle. Each DataProvider consists of the following component classes:
- The Connection :-TheConnection object which provides a connection to the database
- The Command :-The Command object which is used to execute a command
- The DataReader:- The DataReader object which provides a forward-only, read only, connected recordset
- The DataAdapter :-The DataAdapter object which populates a disconnected DataSet with data and performs update
- A connection object create the connection for the application with the database. The command object provides direct execution of the command to the database. If the command returns more than a single value, the command object returns a DataReader to provide the data. Alternatively, the DataAdapter can be used to fill the Dataset object. The database can be updated using the command object or the DataAdapter.