Share via


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 값 중 하나입니다. 기본값은 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 처리됩니다.

Output, InputOutReturnValue 를 호출 ExecuteReader 하여 반환된 매개 변수는 에서 또는 OdbcDataReaderDispose 를 호출 Close 할 때까지 액세스할 수 없습니다.

적용 대상

추가 정보