ADO Ado.net 2.0 Feature Matrix
Bob Beauchemin
DevelopMentor
July 2004
Applies To:
Microsoft ado.net 2.0
Microsoft SQL Server 2005
Summary:ADO.NET 2.0 includes a new Base-class provider model, features for all providers, and
Changes to System.Data.SqlClient. Get a overview of the new features, examples of their use, and a
Chart of which features are provider-neutral and sqlclient-specific. (Printed pages)
Contents
The base-class-based Provider Model
Connection Pooling Enhancements
Asynchronous Commands
Bulk Import
Provider Statistics
AttachDbFileName
SQL Server 2005-specific Features in SqlClient
Conclusion
Ado.net 2.0 comes with a plethora of new features. This includes a new base-class–based provider
Model and features that all providers can take advantage of, as, as, changes, are to
System.Data.SqlClient. Because the. NET Framework 2.0 is being released into conjunction with SQL
Server, some of these features require SQL Server, usable. This article was meant to serve
As a overview and roadmap of the new features, give examples of their use, and includes a chart of
Which features are provider-neutral and which are. In future articles in this series, I ' ll
Be going over some of the features in greater detail. In addition, there are many new features of the
The DataSet and friends; These would be covered in future articles.
The base-class-based Provider Model
In Ado.net 1.0 and 1.1, provider writers implemented a series of provider-specific classes. Generic
Coding is possible based on the fact which each of the classes implemented a generic. As an
Example, System.Data.SqlClient contains the class SqlConnection and this class implements
IDbConnection. System.Data.OracleClient contains the class OracleConnection, which also
Implements IDbConnection. The provider-specific classes could implement Data-source–specific
Properties and methods, e.g., SqlConnection implements the Database property and the
ChangeDatabase method. OracleConnection does not, because the Oracle database does not have the
Concept of multiple "databases" (these are known as catalogs in ANSI SQL) per database instance. The
New provider model in Ado.net 2.0 are based on a series to base classes in System.Data.Common.
These provide a basic implementation of common functionality and, of course, each of the base classes
Implements the still-required generic interface for backward compatibility. Provider writers can choose to
Use the base classes or support the interfaces.
There were two exceptions to the interface model in previous versions, the
Dataadapter/dbdataadapter and CommandBuilder. The CommandBuilder class provides an
Automatic implementation of INSERT, UPDATE, and DELETE commands that use the same column-set,
For a simple SELECT command. Extending a commandbuilder while keeping the base algorithm that it
Used to create action statements is not possible because the SqlCommandBuilder is a sealed class.
Although there is still no way to reuse the SqlCommandBuilder parameter, parser-a
DbCommandBuilder base class in System.Data.Common. There are new features exposed at the
Base-class level in these classes, too. The Dataadapter/dbdataadapter base classes expose mechanisms
For pushing provider-specific types like SQL Server SqlTypes into the DataSet (the
Returnproviderspecifictypes property) with for batch updates (Statementtype.batch enumeration
Value and UpdateBatchSize property). The DbCommandBuilder common base class includes a property
To indicate concurrency policy choices (the ConflictDetection property).
Provider factories
One of the complications of the interface-based approach in Ado.net 1.0 and 1.1 are that I can ' t call a
constructor on a interface. You must create a concrete instance of a specific class. Previous APIs like
OLE DB and ADO worked around this by overloading the connection string. The connection string
contained the COM PROGID of the provider, and the correct DataSource class was created based on this
PROGID. This is possible because OLE DB DataSource progids were stored in the registry.
' VB6 ADO code, Connection is a interface (actually it ' s _connection)
Dim Conn as Connection
' That's the default provider is MSDASQL, the OLE DB provider for ODBC
' This uses the OLE DB provider for SQL Server
Conn. ConnectionString = "PROVIDER=SQLOLEDB;" ' Other parameters
Deleted
Conn. Open
Ado.net 2.0 has a solution for this. Each data provider registers a ProviderFactory