Name

CommandType

Synopsis

This enumeration sets the IDbCommand.CommandType property, which defines how the IDbCommand.CommandText property is interpreted. If you use Text (the default), the IDbCommand.CommandText is interpreted as a SQL command (e.g., a direct UPDATE, DELETE, INSERT, or SELECT command). If you use StoredProcedure, IDbCommand.CommandText is the name of the stored procedure you want to execute. Some providers support the use of the TableDirect CommandType. In this case, the IDbCommand.CommandText is interpreted as the name of a table from which rows will be retrieved (in a SELECT * FROM TableName style). You can also use a comma-delimited list of tables on which a join is performed. TableDirect isn’t supported by all data providers.

public enum CommandType {

   Text = 1,

   StoredProcedure = 4,

   TableDirect = 512

}

Hierarchy

System.Object System.ValueType System.Enum(System.IComparable, System.IFormattable, System.IConvertible) CommandType

Returned By

IDbCommand.CommandType, System.Data.OleDb.OleDbCommand.CommandType, System.Data.OracleClient.OracleCommand.CommandType, System.Data.SqlClient.SqlCommand.CommandType

Passed To

IDbCommand.CommandType, System.Data.OleDb.OleDbCommand.CommandType, System.Data.OracleClient.OracleCommand.CommandType, System.Data.SqlClient.SqlCommand.CommandType

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.