Represents an SQL statement or stored procedure to execute against a data source. This class cannot be inherited.
See Also: OdbcCommand Members
The System.Data.Odbc.OdbcCommand class provides the following methods for executing commands against a data source:
OdbcCommand.ExecuteReader |
Executes commands that return rows. |
OdbcCommand.ExecuteNonQuery |
Executes commands such as SQL INSERT, DELETE, UPDATE, and SET statements. |
OdbcCommand.ExecuteScalar |
Retrieves a single value, for example, an aggregate value, from a database. |
You can reset the OdbcCommand.CommandText property and reuse the System.Data.Odbc.OdbcCommand object. However, you must close the System.Data.Odbc.OdbcDataReader before you can execute a new or previous command.
If execution of the command causes a fatal System.Data.Odbc.OdbcException such as a SQL Server severity level of 20 or more, System.Data.Odbc.OdbcConnection may close. However, the user can reopen the connection and continue.