SqlCeCommand.CommandType Property
Visual Studio 2008
Gets or sets a value indicating how the CommandText property is interpreted.
Namespace: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (in system.data.sqlserverce.dll)
Version Information
.NET Framework and NET Compact Framework
Supported in 3.5
.NET Framework
Supported in 3.0
.NET Compact Framework and .Net Framework
Supported in 2.0
Assembly: System.Data.SqlServerCe (in system.data.sqlserverce.dll)
/** @property */ public CommandType get_CommandType () /** @property */ public void set_CommandType (CommandType value)
public override function get CommandType () : CommandType public override function set CommandType (value : CommandType)
Property Value
One of the CommandType values. The default is Text.| Exception type | Condition |
|---|---|
| ArgumentException |
The value was not a valid CommandType. |
SQL Server Compact 3.5 SP1 supports only the Text and TableDirectCommandTypes. An unsupported exception is thrown if StoredProcedure is specified.
TableDirect is the fastest way to retrieve data from SQL Server Compact 3.5 SP1, but cannot be used with joined tables.
The Connection, CommandType, and CommandText properties cannot be set if the current connection is performing an Execute or Fetch operation.
The following example creates an instance of SqlCeCommand and sets the CommandType and other properties.
Development Platforms
Windows Vista, Windows Mobile 5.0, Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Mobile 2003 for Pocket PC, Windows CE 5.0Version Information
.NET Framework and NET Compact Framework
Supported in 3.5
.NET Framework
Supported in 3.0
.NET Compact Framework and .Net Framework
Supported in 2.0