Before you start swimming in the deep ocean of ADO.NET, you need to take a quick look at the ADO.NET class hierarchy provided by the .NET Runtime Class Library (also known as Base Class Library, or BCL). These classes represent ADO.NET components.
All ADO.NET functionality in the .NET Runtime Class Library is defined in three general namespaces and a number of provider-specific namespaces. System.Data and System.Data.Common are two general namespaces common to all data providers. The System.Data.SqlTypes namespace is a SQL Server-specific namespace. The remainder of the functionality is defined in the data provider-specific namespaces; some of them are System.Data.OleDb, System.Data.ODBC, and System.Data.SqlClient.
The System.Data namespace defines classes that you can use with all the data providers or without data providers at all. This namespace also defines interfaces that are base classes for the data provider classes. Figure 3-2 shows the System.Data namespace's class hierarchy.
Figure 3-2: The System.Data namespace class hierarchy
The System.Data.Common namespace defines classes common to all data providers. Figure 3-3 shows the System.Data.Common namespace hierarchy.
Figure 3-3: The System.Data.Common namespace hierarchy
The System.Data.SqlTypes namespace defines classes for native SQL Server data types that provide type-safe conversion between the .NET data types and the SQL Server native data types. Figure 3-4 shows the System.Data.SqlTypes namespace hierarchy.
Figure 3-4: The System.Data.SqlTypes namespace hierarchy
In addition to these three namespaces, there are a number of provider-specific namespaces. The class hierarchy models of these namespaces are similar except for the name of the class. The classes defined in the provider-specific namespaces start with the data provider name. For example, the Sql data provider classes start with Sql, and the OleDb data provider classes start with OleDb. The Command object class of the Sql data provider is SqlCommand, and the Command object class of the OleDb data provider is OleDbCommand.
In this section, you'll see only the System.Data.OleDb namespace class hierarchy because all the data providers (including System.Data.Sql and System.Data.Odbc) implement the same class hierarchy model (with minor changes). Figure 3-5 shows the System.Data.OleDb namespace hierarchy.
Figure 3-5: The System.Data.OleDb namespace hierarchy
We discuss these namespaces and their classes in more detail throughout this chapter and Chapter 4.