OracleConnection.State Proprietà

Definizione

Ottiene lo stato corrente della connessione.Gets the current state of the connection.

public:
 property System::Data::ConnectionState State { System::Data::ConnectionState get(); };
public:
 virtual property System::Data::ConnectionState State { System::Data::ConnectionState get(); };
[System.ComponentModel.Browsable(false)]
public System.Data.ConnectionState State { get; }
[System.ComponentModel.Browsable(false)]
public override System.Data.ConnectionState State { get; }
member this.State : System.Data.ConnectionState
Public ReadOnly Property State As ConnectionState
Public Overrides ReadOnly Property State As ConnectionState

Valore della proprietà

Combinazione bit per bit dei valori di ConnectionState.A bitwise combination of the ConnectionState values. Il valore predefinito è Closed.The default is Closed.

Implementazioni

Attributi

Esempio

Nell'esempio seguente viene creata un'istanza di una classe derivata, OracleConnection, viene impostata la relativa ConnectionStringe ne viene visualizzato il State.The following example creates an instance of a derived class, OracleConnection, sets its ConnectionString, and displays its State.

public void createOracleConnection()
{
    using (OracleConnection connection = new OracleConnection())
    {
        connection.ConnectionString = "Data Source=Oracle8i;Integrated Security=yes";
        connection.Open();
        Console.WriteLine("Connection State: " + connection.State);
    }
}
Public Sub createOracleConnection()
    Using connection As New OracleConnection()
        connection.ConnectionString = _
           "Data Source=Oracle8i;Integrated Security=yes"
        connection.Open()
        Console.WriteLine("Connection State: " & connection.State)
    End Using
End Sub

Commenti

Le modifiche di stato consentite sono:The allowed state changes are:

Si applica a