OdbcParameter.Direction Vlastnost

Definice

Získá nebo nastaví hodnotu, která určuje, zda je parametr pouze vstup, výstup-pouze, obousměrný nebo uložená procedura návratový parametr hodnoty.

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í hodnota 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

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

Output, InputOuta ReturnValue parametry vrácené voláním ExecuteReader nelze získat přístup, dokud nebudete volat Close nebo Dispose na OdbcDataReader.

Platí pro

Viz také