The OLE DB Provider

The OLE DB provider interface provides access to a database through an OLE DB provider installed on your computer. Most OLE DB providers are supported, but those that use OLE DB Version 2.5 interfaces aren’t supported. Some unsupported OLE DB interfaces include:

  • OLE DB provider for ODBC (MSDASQL)

  • OLE DB provider for Exchange (ExOLEDB)

  • OLE DB for Internet Publishing (MSDAIPP)

Table A-3 lists some commonly used OLE DB drivers.

Table A-3. Commonly used OLE DB drivers

Name

Description

SQLOLEDB

OLE DB provider for SQL Server

MSDAORA

OLE DB provider for Oracle 7.3 and Oracle 8.

Microsoft.Jet.OLEDB.4.0

OLE DB provider for Access (and other Jet data sources)

All OLE DB types are contained in the System.Data.OleDb namespace (see Table A-4). For low-level information about OLE DB providers, you can refer to the OLE DB programmer’s reference on MSDN at http://msdn.microsoft.com/library/en-us/oledb/htm/oledb_providers_overview.asp.

Table A-4. OLE DB .NET provider classes

Interface

Implementing class

IDbConnection
OleDbConnection
IDbCommand
OleDbCommand

IDataParameter, IDbDataParameter

OleDbParameter

IDataReader, IDataRecord

OleDbDataReader

IDataAdapter, IDbDataAdapter

OleDbDataAdapter
IDbTransaction
OleDbTransaction

The OLE DB managed provider doesn’t include any structures for OLE DB types. However, the OleDbDataReader does include additional methods that allow you to specify the data type when retrieving a column value. Table A-5 shows the mapping ...

Get ADO.NET in a Nutshell 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.