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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.