Assembly: System.Data.SqlServerCe (in system.data.sqlserverce.dll)
/** @property */ public String get_CommandText () /** @property */ public void set_CommandText (String value)
public override function get CommandText () : String public override function set CommandText (value : String)
Property ValueThe SQL statement to execute or the name of the base table to open. The default value is an empty string.
When the CommandType property is set to TableDirect, the CommandText property should be set to the name of the table to be accessed. TableDirect access is the fastest way to retrieve data from SQL Server Mobile. You may be required to use escape character syntax if any of the tables named contain any special characters. All rows and columns of the named table or tables will be returned when you call one of the Execute methods.
You cannot set the Connection, CommandType, and CommandText properties if the current connection is performing an Execute or Fetch operation.
The .NET Compact Framework Data Provider for SQL Server Mobile supports named parameters for passing parameters to an SQL statement called by a SqlCeCommand when CommandType is set to Text. For example:
SELECT * FROM Customers WHERE CustomerID = @customerID
The Data Provider for SQL Server Mobile also does not support batch queries. Commands must follow the following form: SELECT * FROM Customers and not SELECT * FROM Customers; SELECT * FROM Orders. If you are using code generated for System.Data.SqlClient, you may have to modify your queries to conform to this restriction.
Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows XP Professional x64 Edition, Windows XP SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.