IVsDataExplorerConnectionManager.AddConnection メソッド

指定したプロパティを使用して新しいデータ接続を追加します。

名前空間:  Microsoft.VisualStudio.Data.Services
アセンブリ:  Microsoft.VisualStudio.Data.Services (Microsoft.VisualStudio.Data.Services.dll 内)

構文

'宣言
Function AddConnection ( _
    connectionName As String, _
    provider As Guid, _
    connectionString As String, _
    encryptedString As Boolean _
) As IVsDataExplorerConnection
IVsDataExplorerConnection AddConnection(
    string connectionName,
    Guid provider,
    string connectionString,
    bool encryptedString
)
IVsDataExplorerConnection^ AddConnection(
    String^ connectionName, 
    Guid provider, 
    String^ connectionString, 
    bool encryptedString
)
abstract AddConnection : 
        connectionName:string * 
        provider:Guid * 
        connectionString:string * 
        encryptedString:bool -> IVsDataExplorerConnection 
function AddConnection(
    connectionName : String, 
    provider : Guid, 
    connectionString : String, 
    encryptedString : boolean
) : IVsDataExplorerConnection

パラメーター

  • provider
    型 : System.Guid
    DDEX プロバイダーの GUID。
  • connectionString
    型 : System.String
    接続文字列、接続プロパティを含む暗号化または暗号化された形式で。
  • encryptedString
    型 : System.Boolean
    connectionString のパラメーター (true) が暗号化するかどうかを示す Boolean の値 (false)。

戻り値

型 : Microsoft.VisualStudio.Data.Services.IVsDataExplorerConnection
新しいデータ接続を表す IVsDataExplorerConnection のオブジェクト。

解説

新しい接続を作成すると、Visual Studio サーバー エクスプローラーのデータ接続の名前は既定でサーバー名、データベース名、スキーマから構成される複合文字列です。ただし、データ接続のカスタムの名前を指定できます。このメソッドは、データ接続の名前を設定できるようになります。

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

関連項目

IVsDataExplorerConnectionManager インターフェイス

Microsoft.VisualStudio.Data.Services 名前空間