System.Data.SqlClient Namespace SqlParameter Class
Sets or retrieves the native data type of the parameter.
Script |
SqlParameter.DBType [ = enumValue ] |
enumValue |
One of the DBType values. |
The property is read/write with a default value of Variant.
IDataParameter.DbType
Use the DBType property to specify or determine the native data type of a given parameter.
DbType and SqlDbType are linked. Setting the DbType changes the SqlDbType to a supported SqlDbType enum value.
The following example initializes an SqlParameter and sets some of its properties.
public void CreateSqlParameter ( ) {
SqlParameter myParam = new SqlParameter ( "@Description", DbType.VarChar, 100 );
myParam.Direction = ParameterDirection.Output;
}
Public Sub CreateSqlParameter ( )
Dim myParam As New SqlParameter ( "@Description", DbType.VarChar, 100 )
myParam.Direction = ParameterDirection.Output
End Sub |
|
C# |
VB |
SqlParameter Members