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 (SQLConnection, String, CommandType, SQLParameter[])

Initializes a new instance of the SQLCommand class with a SQLConnection, the command text, a CommandType, and parameters.

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

Parameters

activeConnection
An SQLConnection that represents the connection.
cmdText
The text of the query command.
cmdType
One of the CommandType values.
parameters
An array of SQLParameter objects.

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 cmdType
ActiveConnection A new SQLConnection that is activeConnection.
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