DbConnection.ServerVersion 属性

定义

在派生类中重写时,获取表示对象所连接到的服务器的版本的字符串。When overridden in a derived class, gets a string that represents the version of the server to which the object is connected.

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

属性值

String

数据库的版本。The version of the database. 返回的字符串的格式取决于您正在使用的连接的特定类型。The format of the string returned depends on the specific type of connection you are using.

属性

例外

当返回的任务未完成,且在调用 OpenAsync 后未打开连接时,调用了 ServerVersionServerVersion was called while the returned Task was not completed and the connection was not opened after a call to OpenAsync.

适用于