CommandType CommandType CommandType CommandType Enum

定义

指定如何解释命令字符串。Specifies how a command string is interpreted.

public enum class CommandType
public enum CommandType
type CommandType = 
Public Enum CommandType
继承

字段

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

SQL 文本命令。An SQL text command. (默认。)(Default.)

注解

CommandType属性设置为 StoredProcedure,CommandText属性应设置为存储过程的名称,若要访问。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. 当调用其中一个命令对象的 Execute 方法时,将返回所有行和已命名的表或表的列。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.

CommandType属性设置为 TableDirect,CommandText属性应设置为的表的名称,若要进行访问。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. 在调用 Execute 方法之一时,将返回所有行和列的已命名的表。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. CommandText属性命名多个表,则返回指定表的联接。When the CommandText property names multiple tables, a join of the specified tables is returned.

备注

TableDirect 仅受 OLE DB.NET Framework 数据提供程序。TableDirect is only supported by the .NET Framework Data Provider for OLE DB. 多个表访问不受支持时TableDirect设置为TableDirectMultiple table access is not supported when TableDirect is set to TableDirect.

适用于