NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

SQLCommand Constructor (String, SQLConnection)

Initializes a new instance of the SQLCommand class with the given command text and a SQLConnection.

[Visual Basic]
Overloads Public Sub New( _
   ByVal cmdText As String, _
   ByVal connection As SQLConnection _
)
[C#]
public SQLCommand(
   string cmdText,
   SQLConnection connection
);
[C++]
public: SQLCommand(
   String* cmdText,
   SQLConnection* connection
);
[JScript]
public function SQLCommand(
   cmdText : String,
   connection : SQLConnection
);

Parameters

cmdText
The text of the query command.
connection
An SQLConnection that represents the connection.

Remarks

When an instance of SQLCommand is created, the following read/write properties are set to initial values.

Properties Initial Value
CommandText cmdText
CommandTimeout 30
CommandType CommandType.Text
ActiveConnection A new SQLConnection that is connection.
CommandBehavior 0

You can change the value for any of these properties through a separate call to the property.

Example

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

See Also

SQLCommand Class | SQLCommand Members | System.Data.SQL Namespace | SQLCommand Constructor Overload List