OdbcParameter.Direction プロパティ

定義

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

public:
 virtual property System::Data::ParameterDirection Direction { System::Data::ParameterDirection get(); void set(System::Data::ParameterDirection value); };
public:
 property System::Data::ParameterDirection Direction { System::Data::ParameterDirection get(); void set(System::Data::ParameterDirection value); };
public override System.Data.ParameterDirection Direction { get; set; }
public System.Data.ParameterDirection Direction { get; set; }
member this.Direction : System.Data.ParameterDirection with get, set
Public Overrides Property Direction As ParameterDirection
Public 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 使用して処理されます。

OutputInputOutReturnValueを呼び出すか、 で を呼び出ExecuteReaderすまでは、 を呼び出DisposeCloseして返されるパラメーターにOdbcDataReaderアクセスできません。

適用対象

こちらもご覧ください