System.Data.Odbc.OdbcCommand Class

Represents an SQL statement or stored procedure to execute against a data source. This class cannot be inherited.

See Also: OdbcCommand Members


[System.ComponentModel.ToolboxItem("System.Drawing.Design.ToolboxItem, System.Drawing, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.Designer("Microsoft.VSDesigner.Data.VS.OdbcCommandDesigner, Microsoft.VSDesigner, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")]
public sealed class OdbcCommand : System.Data.Common.DbCommand, ICloneable


The System.Data.Odbc.OdbcCommand class provides the following methods for executing commands against a data source:


Executes commands that return rows.


Executes commands such as SQL INSERT, DELETE, UPDATE, and SET statements.


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.


Namespace: System.Data.Odbc
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0,