System.Data.SqlClient Namespace SqlCommand Class
Initializes a new instance of the SqlCommand class.
[ VB ]
Public Sub New ( )
[ C# ]
public SqlCommand ( );
[ C++ ]
public: SqlCommand ( );
[ JScript ]
public function SqlCommand ( );
The base constructor initializes all fields to their default values. The following table shows initial property values for an instance of SqlCommand created with this constructor.
You can change the value for any of these properties through a separate call
to the property.
The following example initializes an SqlCommand using this constructor and sets some of its properties.
void setSqlCommand ( ) {
SqlCommand myCommand = new SqlCommand ( );
myCommand.CommandTimeout = 15;
myCommand.CommandType = CommandType.Text;
}
Public Sub setSqlCommand ( )
Dim myCommand As New SqlCommand ( )
myCommand.CommandTimeout = 15
myCommand.CommandType = CommandType.Text
End Sub |
|
C# |
VB |
SqlCommand Members SqlCommand Constructor Overload List