Comments/Troubleshooting

All Connection objects implement the IDbConnection interface from the System.Data namespace and are thus quite similar. Provider-specific connection objects sometimes differ by adding new informational properties and slightly different methods for supporting transactions and connection pooling.

Some Connection classes for ADO.NET providers are shown in Table 18-1.

Table 18-1. Provider-specific Connection classes

Class

Data source

System.Data.SqlClient.SqlConnection

SQL Server

System.Data.OleDb.OleDbConnection

An OLE DB provider

System.Data.Odbc.OdbcConnection

An ODBC driver

System.Data.OleDb.OracleConnection

Oracle

Get ADO.NET in a Nutshell now with O’Reilly online learning.

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