Using Connection, Command, and Data Adapter Objects

Each of these objects come in four types, each in their own namespaces, depending on the data provider you're using:

  • For OLE DB data providers, you use OleDbConnection, OleDbCommand, and OleDbDataAdapter objects from the System.Data.OleDb namespace.

  • For SQL Server, you use SqlConnection, SqlCommand, and SqlDataAdapter objects from the System.Data.SqlClient namespace.

  • For ODBC data providers, you use OdbcConnection, OdbcCommand, and OdbcDataAdapter objects from the System.Data.Odbc namespace.

  • For Oracle, you use OracleConnection, OracleCommand, and OracleDataAdapter objects from the System.Data.OracleClient namespace.

We'll see how this works by taking a look at the various data objects we need—connection ...

Get Microsoft® Visual C#® .NET 2003 Kick Start now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.