CommandType CommandType CommandType CommandType Enum

Definition

Specifies how a command string is interpreted.

public enum class CommandType
public enum CommandType
type CommandType = 
Public Enum CommandType
Inheritance

Fields

StoredProcedure StoredProcedure StoredProcedure StoredProcedure 4

The name of a stored procedure.

TableDirect TableDirect TableDirect TableDirect 512

The name of a table.

Text Text Text Text 1

An SQL text command. (Default.)

Remarks

When the CommandType property is set to StoredProcedure, the CommandText property should be set to the name of the stored procedure to be accessed. The user may be required to use escape character syntax or include qualifying characters if any of the specified tables named contain any special characters. All rows and columns of the named table or tables will be returned when you call one of the Execute methods of a Command object.

When the CommandType property is set to TableDirect, the CommandText property should be set to the name of the table to be accessed. The user may be required to use escape character syntax or include qualifying characters if any of the tables named contain any special characters. All rows and columns of the named table will be returned when you call one of the Execute methods.

In order to access multiple tables, use a comma delimited list, without spaces or padding, containing the names of the tables to access. When the CommandText property names multiple tables, a join of the specified tables is returned.

Note

TableDirect is only supported by the .NET Framework Data Provider for OLE DB. Multiple table access is not supported when TableDirect is set to TableDirect.

Applies to