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 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.