OdbcParameter.Direction プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
パラメーターが入力専用、出力専用、双方向、またはストアド プロシージャの戻り値パラメーターかどうかを示す値を取得または設定します。
public:
property System::Data::ParameterDirection Direction { System::Data::ParameterDirection get(); void set(System::Data::ParameterDirection value); };
public:
virtual property System::Data::ParameterDirection Direction { System::Data::ParameterDirection get(); void set(System::Data::ParameterDirection value); };
public System.Data.ParameterDirection Direction { get; set; }
public override System.Data.ParameterDirection Direction { get; set; }
member this.Direction : System.Data.ParameterDirection with get, set
Public Property Direction As ParameterDirection
Public Overrides Property Direction As ParameterDirection
プロパティ値
ParameterDirection値の 1 つ。 既定値は Input です。
実装
例外
プロパティが有効な ParameterDirection 値のいずれかに設定されていません。
例
次の例では、 OdbcParameter を作成し、そのプロパティの一部を設定します。
Public Sub CreateMyProc(connection As OdbcConnection)
Dim command As OdbcCommand = connection.CreateCommand()
command.CommandText = "{ call MyProc(?,?,?) }"
command.Parameters.Add("", OdbcType.Int).Value = 1
command.Parameters.Add("", OdbcType.Decimal).Value = 2
command.Parameters.Add("", OdbcType.Decimal).Value = 3
End Sub
public void CreateMyProc(OdbcConnection connection)
{
OdbcCommand command = connection.CreateCommand();
command.CommandText = "{ call MyProc(?,?,?) }";
command.Parameters.Add("", OdbcType.Int).Value = 1;
command.Parameters.Add("", OdbcType.Decimal).Value = 2;
command.Parameters.Add("", OdbcType.Decimal).Value = 3;
}
注釈
ParameterDirectionがOutputされ、関連付けられているOdbcCommandの実行で値が返されない場合、OdbcParameterには null 値が含まれます。 null 値は、 DBNull クラスを使用して処理されます。
Output、InputOut、および呼び出しExecuteReaderによって返されるReturnValueパラメーターは、OdbcDataReaderでCloseまたはDisposeを呼び出すまでアクセスできません。