The Microsoft .NET Framework promises to dramatically change the way you and I develop applications—including how we provide data access. ADO.NET, the next generation of ADO, will be the primary data access API for Microsoft .NET applications. If you already know ADO, you'll have a head start on learning ADO.NET. The .NET Framework contains two managed data providers: System.Data.ADO, which exposes generic data-access classes, and System.Data.SQL, which provides SQL Server-specific data-access classes. Here's a preview of the seven main objects in the ADO.NET architecture.
Shared by both the System.Data.ADO and the System.Data.SQL namespaces, the ADO.NET DataSet object is the core component of the ADO.NET architecture. DataSet, an in-memory database cache for use in disconnected operations, contains a complete collection of tables, relationships, and constraints. ADO.NET posts changes to DataSet's contents in batch to the target data source. DataSet corresponds to ADO's disconnected Recordset object.
The SQLDataSetCommand object represents a database query or stored procedure that you use to populate the ADO.NET DataSet object. SQLDataSetCommand corresponds, in part, to the functionality that ADO's Command object provides.
The SQLCommand object represents a T-SQL statement or stored procedure that SQL Server will execute. SQLCommand corresponds to another piece of functionality that ADO's Command object provides.
You use the SQLParameter object to pass parameters to the SQLCommand or SQLDataSetCommand object. When you use SQLParameter to pass a parameter to SQLCommand, SQLParameter represents a parameter that a T-SQL statement or stored procedure can use. When you use SQLParameter to pass a parameter to SQLDataSetCommand, SQLParameter represents a column from a result set. SQLParameter corresponds to ADO's Parameter object.
The SQLConnection object represents an open connection to a SQL Server data source. This object is like ADO's standard Connection object.
Like ADO's fast, forward-only Recordset object, the SQLDataReader object reads a forward-only data stream from a SQL Server database. Unlike most other ADO.NET objects, SQLDataReader works with an open database connection.
The SQLError object collects information about runtime warnings and error conditions that an ADO.NET application encounters. SQLError corresponds to ADO's Error object.