Overview of the Provider Independent Model
ADO.NET 2.0 introduces new base classes in thenamespace. The base classes are abstract, which means that they can't be directly instantiated. They include , , and and are shared by the .NET Framework data providers, such as and . The addition of base classes simplifies adding functionality to the .NET Framework data providers without having to create new interfaces.
In addition, the introduction of abstract base classes with ADO.NET 2.0 enables a developer to write generic data access code that does not depend on a specific data provider.
The Factory Design Pattern
The programming model for writing provider-independent code is based on the use of the "factory" design pattern, which uses a single API to access databases across multiple providers. This pattern is aptly named, as it calls for the use of a specialized object solely to create other objects, much like a real-world factory. For a more detailed description of the factory design pattern, see "Writing Generic Data Access Code in ASP.NET 2.0 and ADO.NET 2.0" on MSDN.
In ADO.NET 2.0, theclass provides static (or Shared in Visual Basic) methods for creating a instance. The instance then returns a correct strongly typed object based on provider information and the connection string supplied at run time. See for code samples demonstrating the use of the factory design pattern in ADO.NET.