MySqlCommandCommandText Property |
Namespace: MySql.Data.MySqlClient
Assembly: MySql.Data (in MySql.Data.dll) Version: 6.9.9

public override string CommandText { get; set; }
Public Overrides Property CommandText As String Get Set
public: virtual property String^ CommandText { String^ get () override; void set (String^ value) override; }
abstract CommandText : string with get, set override CommandText : string with get, set
Property Value
Type: StringThe SQL statement or stored procedure to execute. The default is an empty string.
Implements
IDbCommandCommandText
When the CommandType property is set to StoredProcedure, the CommandText property should be set to the name of the stored procedure. The user may be required to use escape character syntax if the stored procedure name contains any special characters. The command executes this stored procedure when you call one of the Execute methods. Starting with Connector/Net 5.0, having both a stored function and stored procedure with the same name in the same database is not supported. It is suggested that you provide unqiue names for your stored routines.

public void CreateMySqlCommand() { MySqlCommand myCommand = new MySqlCommand(); myCommand.CommandText = "SELECT * FROM mytable ORDER BY id"; myCommand.CommandType = CommandType.Text; }
Public Sub CreateMySqlCommand() Dim myCommand As New MySqlCommand() myCommand.CommandText = "SELECT * FROM Mytable ORDER BY id" myCommand.CommandType = CommandType.Text End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
