The Provider Factory Model

ADO.NET 2.0 introduces a provider factory model, as well as common base classes (DbConnection, DbCommand, and so on) for the various ADO.NET classes. Before we take a closer look at the new features, let’s take a brief look at why the interfaces (IDbConnection, IDbCommand, and so on) that were already available in ADO.NET version 1.0 left room for improvement.

Limitations of the ADO.NET Common Interfaces

Each Connection class (SqlConnection, OracleConnection, and so on) in the initial releases of ADO.NET implemented a common interface—IDbConnection. You could cast any Connection class to the IDbConnection interface and perform common tasks (such as setting the ConnectionString property or opening or closing the connection ...

Get Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.