Comments/Troubleshooting

All Command objects implement the IDbCommand interface from the System.Data namespace, and are thus quite similar. In all basic ADO.NET providers, the Command object encapsulates a SQL statement or stored procedure call.

Some Command classes for ADO.NET providers are shown in Table 19-1.

Table 19-1. Provider-specific Command classes

Class

Data source

System.Data.SqlClient.SqlCommand

SQL Server

System.Data.OleDb.OleDbCommand

An OLE DB provider

System.Data.Odbc.OdbcCommand

An ODBC driver

System.Data.OleDb.OracleCommand

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.