共用方式為


OracleConnection.ServerVersion 屬性

定義

取得包含用戶端已連接之伺服器版本的字串。

public:
 property System::String ^ ServerVersion { System::String ^ get(); };
public:
 virtual property System::String ^ ServerVersion { System::String ^ get(); };
[System.ComponentModel.Browsable(false)]
public string ServerVersion { get; }
[System.ComponentModel.Browsable(false)]
public override string ServerVersion { get; }
[<System.ComponentModel.Browsable(false)>]
member this.ServerVersion : string
Public ReadOnly Property ServerVersion As String
Public Overrides ReadOnly Property ServerVersion As String

屬性值

連接伺服器的版本。

屬性

例外狀況

連接關閉。

範例

下列範例會建立 , OracleConnection 並顯示其部分唯讀屬性。

public void CreateOracleConnection()
{
    string connectionString = "Data Source=Oracle8i;Integrated Security=yes";
    using (OracleConnection connection = new OracleConnection(connectionString))
    {
        connection.Open();
        Console.WriteLine("ServerVersion: " + connection.ServerVersion
            + "\nState: " + connection.State);
    }
}
Public Sub CreateOracleConnection()
    Dim connectionString As String = "Data Source=Oracle8i;Integrated Security=yes"
    Using connection As New OracleConnection(connectionString)
        connection.Open()
        Console.WriteLine("ServerVersion: " & connection.ServerVersion _
           + ControlChars.NewLine + "State: " & connection.State)
    End Using
End Sub

備註

屬性 ServerVersion 為 Oracle 版本格式。 例如,Oracle8 版本的格式是格式為 “8.1.7.0.0 Oracle8 Release 8.1.7.0.0 - Production” 的字符串。

適用於