Application.GetServerInfo 方法

Returns the SQL Server version number of the SQL Server product installed on the target server. 

命名空间:  Microsoft.SqlServer.Dts.Runtime
程序集:  Microsoft.SqlServer.ManagedDTS(在 Microsoft.SqlServer.ManagedDTS.dll 中)

语法

声明
Public Sub GetServerInfo ( _
    server As String, _
    <OutAttribute> ByRef serverVersion As String _
)
用法
Dim instance As Application 
Dim server As String 
Dim serverVersion As String

instance.GetServerInfo(server, serverVersion)
public void GetServerInfo(
    string server,
    out string serverVersion
)
public:
void GetServerInfo(
    String^ server, 
    [OutAttribute] String^% serverVersion
)
member GetServerInfo : 
        server:string * 
        serverVersion:string byref -> unit
public function GetServerInfo(
    server : String, 
    serverVersion : String
)

参数

  • server
    类型:System.String
    The name of the server hardware to check for the SQL Server product version.
  • serverVersion
    类型:System.String%
    The version number of the SQL Server product, defined as an out parameter.

注释

The default value of this property is 9.

示例

The following example retrieves the SQL Server version number from the specified server.

static void Main(string[] args)
        {
            Application app = new Application();
            String outParam;
            app.GetServerInfo("yourserver", out outParam);
            Console.WriteLine("Server version? " + outParam);
        }
Sub Main(ByVal args() As String)
    Dim app As Application =  New Application() 
    Dim outParam As String
    app.GetServerInfo("yourserver", out outParam)
    Console.WriteLine("Server version? " + outParam)
End Sub

请参阅

参考

Application 类

Microsoft.SqlServer.Dts.Runtime 命名空间