メモ : この名前空間、クラス、およびメンバは、.NET Framework Version 1.1 だけでサポートされています。
パラメータが入力専用、出力専用、双方向、またはストアド プロシージャの戻り値パラメータのいずれであるかを示す値を取得または設定します。
Public Overridable Property Direction As ParameterDirection _ Implements IDataParameter.Direction
[C#]
public virtual ParameterDirection Direction {get; set;}
[C++]
public: __property virtual ParameterDirection get_Direction();public: __property virtual void set_Direction(ParameterDirection);
[JScript]
public function get Direction() : ParameterDirection;public function set Direction(ParameterDirection);
プロパティ値
ParameterDirection 値の 1 つ。既定値は Input です。
実装
例外
例外の種類 | 条件 |
---|---|
ArgumentException | プロパティが、有効な ParameterDirection 値に設定されませんでした。 |
解説
ParameterDirection が Output で、関連付けられた OdbcCommand が値を返さなかった場合、 OdbcParameter には null 値が格納されます。null 値は、 DBNull クラスを使用して操作できます。
ExecuteReader の呼び出しで返された Output 、 InputOut 、および ReturnValue の各パラメータには、 OdbcDataReader で Close または Dispose を呼び出すまでアクセスできません。
使用例
[Visual Basic, C#, C++] OdbcParameter を作成し、そのプロパティの一部を設定する例を次に示します。
Public Sub CreateMyProc(myConnection As OdbcConnection)
Dim myCommand As OdbcCommand = myConnection.CreateCommand()
myCommand.CommandText = "{ call MyProc(?,?,?) }"
myCommand.Parameters.Add("", OdbcType.Int).Value = 1
myCommand.Parameters.Add("", OdbcType.Decimal).Value = 2
myCommand.Parameters.Add("", OdbcType.Decimal).Value = 3
End Sub ' CreateMyProc
[C#]
public void CreateMyProc(OdbcConnection myConnection)
{
OdbcCommand myCommand = myConnection.CreateCommand();
myCommand.CommandText = "{ call MyProc(?,?,?) }";
myCommand.Parameters.Add("", OdbcType.Int).Value = 1;
myCommand.Parameters.Add("", OdbcType.Decimal).Value = 2;
myCommand.Parameters.Add("", OdbcType.Decimal).Value = 3;
}
[C++]
public:
void CreateMyProc(OdbcConnection* myConnection)
{
OdbcCommand* myCommand = myConnection->CreateCommand();
myCommand->CommandText = S"{ call MyProc(?,?,?) }";
myCommand->Parameters->Add(S"", OdbcType::Int)->Value = __box(1);
myCommand->Parameters->Add(S"", OdbcType::Decimal)->Value = __box(2);
myCommand->Parameters->Add(S"", OdbcType::Decimal)->Value = __box(3);
}
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
OdbcParameter クラス | OdbcParameter メンバ | System.Data.Odbc 名前空間