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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.