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
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access