共用方式為


IVsDataConnectionManager.GetConnection 方法 (Guid, String, Boolean, Boolean)

擷取現有資料連接或建立符合所指定的提供者 GUID 和連接字串的新的資料連接。 此外,選擇性地更新傳回的連接的連接字串。

命名空間:  Microsoft.VisualStudio.Data.Services
組件:  Microsoft.VisualStudio.Data.Services (在 Microsoft.VisualStudio.Data.Services.dll 中)

語法

'宣告
Function GetConnection ( _
    provider As Guid, _
    connectionString As String, _
    encryptedString As Boolean, _
    update As Boolean _
) As IVsDataConnection
IVsDataConnection GetConnection(
    Guid provider,
    string connectionString,
    bool encryptedString,
    bool update
)
IVsDataConnection^ GetConnection(
    Guid provider, 
    String^ connectionString, 
    bool encryptedString, 
    bool update
)
abstract GetConnection : 
        provider:Guid * 
        connectionString:string * 
        encryptedString:bool * 
        update:bool -> IVsDataConnection
function GetConnection(
    provider : Guid, 
    connectionString : String, 
    encryptedString : boolean, 
    update : boolean
) : IVsDataConnection

參數

  • provider
    類型:Guid

    DDEX 提供者的 GUID。

  • connectionString
    類型:String

    連接字串以未加密的加密格式。

  • encryptedString
    類型:Boolean

    表示連接字串是否 Boolean 值加密 (true) 或未加密 (false)。

  • update
    類型:Boolean

    指出是否 Boolean 值應該更新資料連接的連接字串值和所指定的連接字串 (true) (false)。

傳回值

類型:Microsoft.VisualStudio.Data.Services.IVsDataConnection
表示資料連接的 IVsDataConnection 物件。

.NET Framework 安全性

請參閱

參考

IVsDataConnectionManager 介面

GetConnection 多載

Microsoft.VisualStudio.Data.Services 命名空間