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[] );
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.
The following example creates a SQLCommand and sets some of its properties.
SQLCommand Class | SQLCommand Members | System.Data.SQL Namespace | SQLCommand Constructor Overload List