CHAPTER 21 ADO.NET PART I: THE CONNECTED LAYER
Figure 21-14. The interconnected Orders, Inventory, and Customers tables
With this, the AutoLot database is complete! Of course, this is a far cry from a real-world corporate
database, but it will serve your needs over the remainder of this book. Now that you have a database to
test with, you can dive into the details of the ADO.NET data provider factory model.
The ADO.NET Data Provider Factory Model
The .NET data provider factory pattern allows you to build a single code base using generalized data
access types. Furthermore, using application configuration files (and the
subelement), you can obtain providers and connection strings declaratively, without the need to
recompile or redeploy the assembly that uses the ADO.NET APIs.
To understand the data provider factory implementation, recall from Table 21-1 that the classes
within a data provider each derive from the same base classes defined within the System.Data.Common
namespace.
824
•
DbCommand: The abstract base class for all command classes
•
DbConnection: The abstract base class for all connection classes
•
DbDataAdapter: The abstract base class for all data adapter classes
•
DbDataReader: The abstract base class for all data reader classes
•
DbParameter: The abstract base class for all parameter classes
•
DbTransaction: The abstract base class for all transaction classes