ServerConnection Constructor (String, String, String)

指定されたサーバー インスタンスおよびログオン資格情報を使用して、ServerConnection クラスの新しいインスタンスを初期化します。

名前空間: Microsoft.SqlServer.Management.Common
アセンブリ: Microsoft.SqlServer.ConnectionInfo (microsoft.sqlserver.connectioninfo.dll 内)

構文

'宣言
Public Sub New ( _
    serverInstance As String, _
    userName As String, _
    password As String _
)
public ServerConnection (
    string serverInstance,
    string userName,
    string password
)
public:
ServerConnection (
    String^ serverInstance, 
    String^ userName, 
    String^ password
)
public ServerConnection (
    String serverInstance, 
    String userName, 
    String password
)
public function ServerConnection (
    serverInstance : String, 
    userName : String, 
    password : String
)

パラメータ

  • serverInstance
    接続を確立するサーバーのインスタンスの名前を示す String 値です。
  • userName
    参照された接続を確立するために使用するログオン アカウントを示す String 値です。
  • password
    ログオン アカウントで使用するパスワードを示す String 値です。

解説

この名前空間、クラス、またはメンバは、Microsoft .NET Framework Version 2.0 でのみサポートされています。

使用例

'Declare a ServerConnection object variable to specify SQL authentication, login and password.
Dim conn As New ServerConnection
conn.LoginSecure = False
conn.Login = vlogin
conn.Password = vpassword
'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server(conn)
'The actual connection is made when a property is retrieved.
Console.WriteLine(srv.Information.Version)
'The connection is automatically disconnected when the Server variable goes out of scope.

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

ServerConnection Class
ServerConnection Members
Microsoft.SqlServer.Management.Common Namespace

その他の技術情報

Visual Basic .NET で SQL Server 認証を使用して SQL Server のインスタンスに接続する方法
SQL Server のインスタンスへの接続