OdbcParameter.Direction プロパティ

定義

パラメーターが入力専用、出力専用、双方向、またはストアド プロシージャの戻り値パラメーターかどうかを示す値を取得または設定します。

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;
}

注釈

ParameterDirectionOutputされ、関連付けられているOdbcCommandの実行で値が返されない場合、OdbcParameterには null 値が含まれます。 null 値は、 DBNull クラスを使用して処理されます。

OutputInputOut、および呼び出しExecuteReaderによって返されるReturnValueパラメーターは、OdbcDataReaderCloseまたはDisposeを呼び出すまでアクセスできません。

適用対象

こちらもご覧ください