Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SqlCeCommand Constructor (String)

Initializes a new instance of the SqlCeCommand class with the text of the query.

Namespace:  System.Data.SqlServerCe
Assembly:  System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)

public SqlCeCommand(
	string commandText
)

Parameters

commandText
Type: System.String
The text of the query.

The following table shows initial property values for an instance of SqlCeCommand.

Properties

Initial Value

CommandText

cmdText

CommandType

Text

Connection

null

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

string queryText = "SELECT * FROM Categories ORDER BY [Category ID]";
SqlCeCommand cmd = new SqlCeCommand(queryText);

cmd.Connection = conn;
cmd.CommandType = CommandType.Text;


Show:
© 2015 Microsoft