Edit

Share via


IDataParameter.Direction Property

Definition

Gets or sets a value indicating whether the parameter is input-only, output-only, bidirectional, or a stored procedure return value parameter.

public:
 property System::Data::ParameterDirection Direction { System::Data::ParameterDirection get(); void set(System::Data::ParameterDirection value); };
public System.Data.ParameterDirection Direction { get; set; }
member this.Direction : System.Data.ParameterDirection with get, set
Public Property Direction As ParameterDirection

Property Value

One of the ParameterDirection values. The default is Input.

Exceptions

The property was not set to one of the valid ParameterDirection values.

Examples

The following example creates an instance of the implementing class, SqlParameter, and sets some of its properties.

public void CreateSqlParameter()
{
    SqlParameter parameter = new SqlParameter(
        "@Description", SqlDbType.VarChar);
    parameter.Direction = ParameterDirection.Output;
}
Public Sub CreateSqlParameter()
    Dim parameter As New SqlParameter( _
        "@Description", SqlDbType.VarChar)
    parameter.Direction = ParameterDirection.Output
End Sub

Remarks

If the ParameterDirection is output, and execution of the associated SqlCommand does not return a value, the IDataParameter contains a null value.

After the last row from the last resultset is read, Output, InputOut, and ReturnValue parameters are updated.

Applies to