ADO.NET's Primary Objects

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.

1. DataSet

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.

2. SQLDataSetCommand

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.

3. SQLCommand

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.

4. SQLParameter

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.

5. SQLConnection

The SQLConnection object represents an open connection to a SQL Server data source. This object is like ADO's standard Connection object.

6. SQLDataReader

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.

7. SQLError

The SQLError object collects information about runtime warnings and error conditions that an ADO.NET application encounters. SQLError corresponds to ADO's Error object.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.