Managed C++ and .NET Development: Visual Studio .NET 2003 Edition

Managed providers provide ADO.NET with the capability to connect to and access data sources. Their main purpose, as far as most developers are concerned, is to provide support for the DataAdapter class. This class is essentially for mapping between the data store and the DataSet.

Currently only four managed providers exist for ADO.NET:

Determining which of these managed providers is actually used depends on the database that ADO.NET interfaces with. Currently, ADO.NET interfaces with four groups of database types: Microsoft SQL Server 7.0 and later, Oracle8i and later, databases that provide ODBC support, and databases that provide OLE DB support. Which database group you are using determines if you implement the System::Data::SqlClient, System::Data::Oracle, System::Data::Odbc, or System: :Data::OleDb namespace.

In addition, the group of databases interfaced with determines which classes you will use. You will find that if you are using the System::Data::SqlClient namespace, then all of your classes will be prefixed with Sql, as in SqlCommand() and SqlDataAdapter(). If you are using the System::Data::Oracle namespace, then the classes will be prefixed with Oracle, as in OracleCommand() and OracleDataAdapter(). If you are using the System::Data::Odbc namespace, then the classes will be prefixed with Odbc, as in OdbcCommand() and OdbcDataAdapter(). And, if are using the System::Data::OleDb namespace, then the classes will be prefixed with OleDb, as in OleDbCommand() and OleDbDataAdapter().

Once you have learned one managed provider, you have pretty much learned all four because they are nearly the same, except for the Sql, OleDb, Odbc, and Oracle prefixes and a few other small differences.

Because this book uses Microsoft SQL Server 2000, I use the SQL Server managed provider and thus the namespace associated with it.

Категории