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:

適用対象