System.Data.SqlClient Namespace SqlParameter Class
Initializes a new instance of the SqlParameter class.
1. Initializes a new instance of the SqlParameter class.
2. Initializes a new instance of the SqlParameter class with the parameter name and value.
3. Initializes a new instance of the SqlParameter class with the parameter name and data type.
4. Initializes a new instance of the SqlParameter class with the parameter name, data type, and width.
5. Initializes a new instance of the SqlParameter class with the parameter name, data type, width, and source column name.
6. Initializes a new instance of the SqlParameter class with the parameter name, data type, width, source column name, parameter direction, numeric precision, and other properties.
The following example initializes an SqlParameter and displays the ParameterName.
NOTE: This example shows how to use one of the overloaded versions of the SqlParameter constructor. For other examples that may be available, see the individual overload topics.
public void CreateSqlParameter ( ) {
SqlParameter myParam = new SqlParameter ( "@Description", SqlDbType.VarChar,
100, ParameterDirection.Output, true, 0, 0, "Description",
DataRowVersion.Current,"garden hose" );
Response.Write ( myParam.ToString ( ) );
}
Public Sub CreateSqlParameter ( )
Dim myParam As New SqlParameter ( "@Description", SqlDbType.VarChar, _
100, ParameterDirection.Output, True, 0, 0, "Description", _
DataRowVersion.Current, "garden hose" )
Response.Write ( myParam.ToString ( ) )
End Sub |
|
C# |
VB |
SqlParameter Members
|
|