Condividi tramite


SqlCeCommand.SqlCeCommand() Constructor

Initializes a new instance of the SqlCeCommand class.

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

Syntax

'Declaration
Public Sub New
'Usage
Dim instance As New SqlCeCommand
public SqlCeCommand ()
public:
SqlCeCommand ()
public SqlCeCommand ()
public function SqlCeCommand ()
Not applicable.

Remarks

The base constructor initializes all fields to their default values. The following table shows initial property values for an instance of SqlCeCommand.

Properties

Initial Value

CommandText

empty string ("")

CommandType

Text

Connection

a null reference (Nothing in Visual Basic)

Example

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

Dim cmd As SqlCeCommand = conn.CreateCommand()
cmd.CommandText = "SELECT * FROM Categories ORDER BY CategoryID"
cmd.CommandType = CommandType.Text
cmd.UpdatedRowSource = UpdateRowSource.Both
SqlCeCommand cmd = conn.CreateCommand();
cmd.CommandText = "SELECT * FROM Categories ORDER BY CategoryID";
cmd.CommandType = CommandType.Text;
cmd.UpdatedRowSource = UpdateRowSource.Both;

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows XP Professional x64 Edition, Windows XP SP2

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

.NET Compact Framework

Supported in: 2.0, 1.0

See Also

Reference

SqlCeCommand Class
SqlCeCommand Members
System.Data.SqlServerCe Namespace