System.Data.CommandType Enumeration

Specifies how a command string is interpreted.

Syntax

public enum CommandType

Remarks

When the System.Data.CommandType property is set to CommandType.StoredProcedure, the IDbCommand.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 System.Data.CommandType property is set to CommandType.TableDirect, the IDbCommand.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 System.Data.CommandType is set to TableDirect.

Members

Member NameDescription
StoredProcedure

The name of a stored procedure.

TableDirect

The name of a table.

Text

An SQL text command. (Default.)

Requirements

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