OracleConnection.State OracleConnection.State OracleConnection.State OracleConnection.State Property

Definizione

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

public:
 virtual property System::Data::ConnectionState State { System::Data::ConnectionState get(); };
[System.ComponentModel.Browsable(false)]
public override System.Data.ConnectionState State { get; }
member this.State : System.Data.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.

Esempi

L'esempio seguente crea un'istanza di una classe derivata OracleConnection, imposta relativo ConnectionStringe Visualizza relativo 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 consentiti sono:The allowed state changes are:

Si applica a