Specifies the text of the SQL statement or the name of the table when the ULCommand.CommandType is System.Data.CommandType.TableDirect. For parameterized statements, use a question mark (?) placeholder to pass parameters.
Visual Basic Public Overrides Property CommandText As String
C# public override string CommandText { get; set; }
A string specifying the text of the SQL statement or the name of the table. The default is an empty string (invalid command).
SELECT statements are marked as read-only by default for performance reasons. If the query is going to be used to make updates, the statement must end with " FOR UPDATE".
The following example demonstrates the use of the parameterized placeholder:
' Visual Basic myCmd.CommandText = "SELECT * FROM Customers WHERE CustomerID = ?" // C# myCmd.CommandText = "SELECT * FROM Customers WHERE CustomerID = ?"; |
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |