Export (0) Print
Expand All

Parameter.Direction Property

Note: This property is new in the .NET Framework version 2.0.

Indicates whether the Parameter object is used to bind a value to a control, or the control can be used to change the value.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public ParameterDirection Direction { get; set; }
/** @property */
public ParameterDirection get_Direction ()

/** @property */
public void set_Direction (ParameterDirection value)

public function get Direction () : ParameterDirection

public function set Direction (value : ParameterDirection)

Property Value

One of the ParameterDirection values. Direction is set to Input by default.

The Direction property is currently not used by the Parameter class and is reserved for future use.

The Direction property describes the direction of the flow of data between the value that a Parameter instance is bound to and the Parameter object itself. The default value for the Direction property, Input, describes the most common scenario where the flow of data is always in one direction: from the value to which the Parameter object is bound to the Parameter object. Any changes made to the underlying value are reflected by the Parameter object, but any changes to the Parameter object are not reflected by the underlying data. You can set the Direction property to InputOutput or Output when working with output parameters, or ReturnValue when working with a return value from a stored procedure.

If the Direction property of the parameter is changed, the OnParameterChanged method is called.

The following code example demonstrates how to set the DefaultValue, Type, and Direction properties of Parameter objects when using them as output parameters and return value parameters with a stored procedure. This code example is part of a larger example provided for the SqlDataSourceStatusEventArgs class overview.

<asp:sqldatasource
    id="SqlDataSource1"
    runat="server"
    datasourcemode="DataSet"
    connectionstring="<%$ ConnectionStrings:MyNorthwind%>"
    selectcommand="getordertotal"
    onselected="OnSelectedHandler">
    <selectparameters>
      <asp:querystringparameter name="empId" querystringfield="empId" />
      <asp:parameter name="total" type="Int32" direction="Output" defaultvalue="0" />
      <asp:parameter name="_ret" type="Int32" direction="ReturnValue" defaultvalue="0" />
    </selectparameters>
</asp:sqldatasource>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft