Represents a table name to execute against a data source.
| C# | Visual Basic |
public sealed class CECommand : DbCommand, IDbCommand, IDisposable
Public NotInheritable Class CECommand _ Inherits DbCommand _ Implements IDbCommand, IDisposable
| All Members | Constructors | Methods | Properties | Events | |
| Icon | Member | Description |
|---|---|---|
| CECommand()()()() |
Initializes a new instance of the CECommand class.
| |
| CECommand(String) |
Initializes a new instance of the CECommand class with a table name.
| |
| CECommand(String, CEConnection) |
Initializes a new instance of the CECommand class with a table name and a CEConnection.
| |
| Cancel()()()() |
This method supports the .NET Compact Framework infrastructure and is not intended to be used directly from your code.
(Overrides DbCommand.Cancel()()()().) | |
| CanRaiseEvents |
Gets a value indicating whether the component can raise an event.
(Inherited from Component.) | |
| CommandText |
Gets or sets a table name to access at the data source.
The Windows CE provider does not support SQL queries.
(Overrides DbCommand.CommandText.) | |
| CommandTimeout |
Gets or sets the wait time before terminating the attempt to execute a command and generating an error.
(Overrides DbCommand.CommandTimeout.) | |
| CommandType |
Gets or sets a value indicating how the CommandText property is interpreted.
Only TableDirect is supported by the Windows CE provider.
(Overrides DbCommand.CommandType.) | |
| Connection |
Gets or sets the DbConnection used by this DbCommand.
(Inherited from DbCommand.) | |
| Container |
Gets the IContainer that contains the Component.
(Inherited from Component.) | |
| CreateDbParameter()()()() |
Not used.
(Overrides DbCommand.CreateDbParameter()()()().) | |
| CreateObjRef(Type) |
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.) | |
| CreateParameter()()()() |
Creates a new instance of a DbParameter object.
(Inherited from DbCommand.) | |
| DbConnection | (Overrides DbCommand.DbConnection.) | |
| DbParameterCollection |
Not supported.
(Overrides DbCommand.DbParameterCollection.) | |
| DbTransaction |
Not used.
(Overrides DbCommand.DbTransaction.) | |
| DesignMode |
Gets a value that indicates whether the Component is currently in design mode.
(Inherited from Component.) | |
| DesignTimeVisible |
Get always returns false; set always throws a NotSupportedException.
(Overrides DbCommand.DesignTimeVisible.) | |
| Dispose()()()() |
Releases all resources used by the Component.
(Inherited from Component.) | |
| Dispose(Boolean) |
Releases the unmanaged resources used by the Component and optionally releases the managed resources.
(Inherited from Component.) | |
| Disposed |
Occurs when the component is disposed by a call to the Dispose()()()() method.
(Inherited from Component.) | |
| Equals(Object) | (Inherited from Object.) | |
| Events |
Gets the list of event handlers that are attached to this Component.
(Inherited from Component.) | |
| ExecuteDbDataReader(CommandBehavior) | (Overrides DbCommand.ExecuteDbDataReader(CommandBehavior).) | |
| ExecuteNonQuery()()()() |
This method supports the .NET Compact Framework infrastructure and is not intended to be used directly from your code.
(Overrides DbCommand.ExecuteNonQuery()()()().) | |
| ExecuteReader()()()() | ||
| ExecuteReader(CommandBehavior) | ||
| ExecuteScalar()()()() |
This method supports the .NET Compact Framework infrastructure and is not intended to be used directly from your code.
(Overrides DbCommand.ExecuteScalar()()()().) | |
| Finalize()()()() |
Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.
(Inherited from Component.) | |
| GetHashCode()()()() |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
| GetLifetimeService()()()() |
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.) | |
| GetService(Type) | (Inherited from Component.) | |
| GetType()()()() |
Gets the Type of the current instance.
(Inherited from Object.) | |
| InitializeLifetimeService()()()() |
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.) | |
| MemberwiseClone(Boolean) |
Creates a shallow copy of the current MarshalByRefObject object.
(Inherited from MarshalByRefObject.) | |
| MemberwiseClone()()()() |
Creates a shallow copy of the current Object.
(Inherited from Object.) | |
| Parameters |
Gets the collection of DbParameter objects.
(Inherited from DbCommand.) | |
| Prepare()()()() |
This method supports the .NET Compact Framework infrastructure and is not intended to be used directly from your code.
(Overrides DbCommand.Prepare()()()().) | |
| Site | (Inherited from Component.) | |
| ToString()()()() |
Returns a String containing the name of the Component, if any. This method should not be overridden.
(Inherited from Component.) | |
| Transaction |
Gets or sets the DbTransaction within which this DbCommand object executes.
(Inherited from DbCommand.) | |
| UpdatedRowSource |
Gets or sets how command results are applied to the DataRow when used by the Update method of the DbDataAdapter.
This property should not be used with the .NET Compact Framework Data Provider for Windows CE.
(Overrides DbCommand.UpdatedRowSource.) |
The following example uses CECommand, along with CEConnection, to select rows from a database.
CopyVB.NET
CopyC#
Dim query As String = "Orders" Dim conn As New CEConnection(connString) Dim cmd As New CECommand(query, conn) conn.Open() Dim rdr As CEDataReader = cmd.ExecuteReader() Try ' Iterate through the results ' While rdr.Read() Dim val1 As Integer = rdr.GetInt32(0) Dim val2 As String = rdr.GetString(1) End While Finally ' Always call Close when done reading ' rdr.Close() ' Always call Close when done reading ' conn.Close() End Try
string query = "Orders"; CEConnection conn = new CEConnection(connString); CECommand cmd = new CECommand(query, conn); conn.Open(); CEDataReader rdr = cmd.ExecuteReader(); try { // Iterate through the results // while (rdr.Read()) { int val1 = rdr.GetInt32(0); string val2 = rdr.GetString(1); } } finally { // Always call Close when done reading // rdr.Close(); // Always call Close when done reading // conn.Close(); }
| Object | ||||
| MarshalByRefObject | ||||
| Component | ||||
| DbCommand | ||||
| CECommand | ||||