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 하나입니다. 기본값은 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 호출로 반환된 매개 변수는 호출 CloseExecuteReader 하거나 Dispose 호출OdbcDataReader할 때까지 액세스할 수 없습니다.

적용 대상

추가 정보