OdbcParameter.Direction Propriedade

Definição

Obtém ou define um valor que indica se o parâmetro é apenas de entrada, saída, bidirecional ou um parâmetro de valor retornado do procedimento armazenado.

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

Valor da propriedade

Um dos valores de ParameterDirection. O padrão é Input.

Implementações

Exceções

A propriedade não foi definida como um dos valores ParameterDirection válidos.

Exemplos

O exemplo a seguir cria um OdbcParameter e define algumas de suas propriedades.

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

Comentários

Se o ParameterDirection for Outpute a execução do associado OdbcCommand não retornar um valor, o OdbcParameter conterá um valor nulo. Os valores nulos são tratados usando a DBNull classe .

OutputOs parâmetros , InputOute ReturnValue retornados pela chamada ExecuteReader não podem ser acessados até que você chame Close ou Dispose no OdbcDataReader.

Aplica-se a

Confira também