Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

SqlCeDataAdapter.SelectCommand Property

Gets or sets an SQL statement used to select records in the data source.

Namespace: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (in system.data.sqlserverce.dll)

public SqlCeCommand SelectCommand { get; set; 
/** @property */
public SqlCeCommand get_SelectCommand ()

/** @property */
public void set_SelectCommand (SqlCeCommand value)

public function get SelectCommand () : SqlCeCommand

public function set SelectCommand (value : SqlCeCommand)

Property Value

A SqlCeCommand that is used during Fill to select records from data source for placement in the DataSet.

When SelectCommand is assigned to a previously-created SqlCeCommand, the SqlCeCommand is not cloned. The SelectCommand maintains a reference to the previously-created SqlCeCommand object.

If the SelectCommand does not return any rows, no tables are added to the DataSet, and no exception is raised.

The following example creates a SqlCeDataAdapter and sets some of its properties.

SqlCeDataAdapter da = new SqlCeDataAdapter();

SqlCeConnection conn = new SqlCeConnection("Data Source = MyDatabase.sdf");
SqlCeCommand cmd = new SqlCeCommand("SELECT * FROM Customers WHERE Country = @country", conn);

cmd.Parameters.Add("@country", SqlDbType.NVarChar, 15);
cmd.Parameters[0].Value = "UK";

da.SelectCommand = cmd;

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

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.

.NET Compact Framework

Supported in: 2.0, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.