OdbcParameter.Direction Vlastnost

Definice

Získá nebo nastaví hodnotu, která označuje, zda je parametr pouze vstup, pouze výstup, obousměrný nebo uložená procedura vrátit hodnotu parametru.

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

Hodnota vlastnosti

Jedna z ParameterDirection hodnot. Výchozí formát je Input.

Implementuje

Výjimky

Vlastnost nebyla nastavena na jednu z platných ParameterDirection hodnot.

Příklady

Následující příklad vytvoří OdbcParameter a nastaví některé jeho vlastnosti.

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

Poznámky

ParameterDirection Pokud je Outputa spuštění přidružené OdbcCommand nevrací hodnotu, OdbcParameter bude obsahovat hodnotu null. Hodnoty Null se zpracovávají pomocí DBNull třídy .

OutputParametry , InputOuta ReturnValue vrácené voláním ExecuteReader nejsou přístupné, dokud nevoláte Close nebo Dispose na OdbcDataReader.

Platí pro

Viz také