Gets or sets the SQL command text to run against the data source.
[Visual Basic] Overridable Public Property CommandText As String [C#] public string CommandText {override get; override set;} [C++] public: __property virtual String* get_CommandText(); public: __property virtual void set_CommandText(String*); [JScript] public function get CommandText() : String; public function set CommandText(String);
The SQL command text to execute. The default value is the empty string ("").
If the assigned string is not the current string, a OnSchemaChanging event is raised and the new value set. then, a OnSchemaChanged event is raised.
The following example creates an ADOCommand and sets some of its properties.
ADOCommand Class | ADOCommand Members | System.Data.ADO Namespace | ActiveConnection | CommandTimeout | CommandType | RowFetchCount | CommandBehavior | NamedParameters