OracleConnection.State Свойство

Определение

Возвращает текущее состояние подключения.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; }
[<System.ComponentModel.Browsable(false)>]
member this.State : System.Data.ConnectionState
Public ReadOnly Property State As ConnectionState
Public Overrides ReadOnly Property State As ConnectionState

Значение свойства

ConnectionState

Поразрядное сочетание значений ConnectionState.A bitwise combination of the ConnectionState values. Значение по умолчанию — Closed.The default is Closed.

Реализации

Атрибуты

Примеры

В следующем примере создается экземпляр производного класса, OracleConnection , задается его свойство ConnectionString и отображается 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

Комментарии

Допустимы следующие смены состояний.The allowed state changes are:

Применяется к