This documentation is archived and is not being maintained.

SqlCeCommand.CommandType Property

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Gets or sets a value indicating how the CommandText property is interpreted.

[Visual Basic]
Public Overridable Property CommandType As CommandType  Implements _
public virtual CommandType CommandType {get; set;}
public: __property virtual CommandType get_CommandType();
public: __property virtual void set_CommandType(CommandType);
public function get CommandType() : CommandType;
public function set CommandType(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 CE supports only the Text and TableDirect. TableDirect is the fastest way to retrieve data from SQL Server CE. An unsupported exception is thrown if StoredProcedure is specified.

The Connection, CommandType, and CommandText properties cannot be set if the current connection is performing an Execute or Fetch operation.


Platforms: .NET Compact Framework

.NET Framework Security: 

See Also

SqlCeCommand Class | SqlCeCommand Members | System.Data.SqlServerCe Namespace | CommandText | UpdatedRowSource