DbCommand.CommandText DbCommand.CommandText DbCommand.CommandText DbCommand.CommandText Property

定义

获取或设置对数据源运行的文本命令。Gets or sets the text command to run against the data source.

public:
 abstract property System::String ^ CommandText { System::String ^ get(); void set(System::String ^ value); };
public abstract string CommandText { get; set; }
member this.CommandText : string with get, set
Public MustOverride Property CommandText As String

属性值

要执行的文本命令。The text command to execute. 默认值为空字符串 ("")。The default value is an empty string ("").

实现

注解

当您将设置CommandTypeStoredProcedure,应设置CommandText属性设置为存储过程的名称。When you set the CommandType to StoredProcedure, you should set the CommandText property to the name of the stored procedure. 该命令执行此存储的过程时调用的一个Execute方法。The command executes this stored procedure when you call one of the Execute methods.

适用于

另请参阅