OdbcParameter.Direction Propiedad

Definición

Obtiene o establece un valor que indica si el parámetro es de solo entrada, solo salida, bidireccional o un parámetro de valor devuelto de procedimiento almacenado.

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

Valor de propiedad

Uno de los ParameterDirection valores. El valor predeterminado es Input.

Implementaciones

Excepciones

La propiedad no se estableció en uno de los valores válidos ParameterDirection .

Ejemplos

En el ejemplo siguiente se crea y OdbcParameter se establecen algunas de sus propiedades.

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

Comentarios

Si es Output, y la ParameterDirection ejecución del asociado OdbcCommand no devuelve un valor , contendrá OdbcParameter un valor NULL. Los valores NULL se controlan mediante la DBNull clase .

OutputNo se puede tener acceso a los parámetros , InputOuty ReturnValue devueltos mediante una llamada ExecuteReader a hasta que llame a Close o Dispose en .OdbcDataReader

Se aplica a

Consulte también