System.Data.SqlClient Namespace SqlParameter Class
Initializes a new instance of the SqlParameter class with the parameter name, data type, and width.
[ VB ]
Overloads Public Sub New ( _
ByVal name As String, _
ByVal dataType As SqlDbType, _
ByVal size As Integer _
)
[ C# ]
public SqlParameter (
string name,
SqlDbType dataType,
int size
);
[ C++ ]
public: SqlParameter (
String* name,
SqlDbType dataType,
int size
);
[ JScript ]
public function SqlParameter (
name : String,
dataType : SqlDbType,
size : int
);
- name
- The name of the parameter to map.
- dataType
- One of the SqlDbType values.
- size
- The width of the parameter.
The Precision is inferred from the SqlDbType parameter.
The following example initializes an SqlParameter using this constructor and sets some of its properties.
public void CreateSqlParameter ( ) {
SqlParameter myParam = new SqlParameter ( "@Description", SqlDbType.VarChar, 100 );
myParam.Direction = ParameterDirection.Output;
}
Public Sub CreateSqlParameter ( )
Dim myParam As New SqlParameter ( "@Description", SqlDbType.VarChar, 100 )
myParam.Direction = ParameterDirection.Output
End Sub |
|
C# |
VB |
SqlParameter Members SqlParameter Constructor Overload List