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
    指示是否的 Boolean 值 connectionString 参数加密(true) (false)。

返回值

类型:Microsoft.VisualStudio.Data.Services.IVsDataExplorerConnection
表示新的数据连接的 IVsDataExplorerConnection 对象。

备注

在创建新的连接时,数据连接的默认名称。Visual Studio 服务器资源管理器中包括服务器名称、数据库名称和模式的复合字符串。但是,您可以提供自定义名称数据连接。此方法允许您设置数据连接名称。

.NET Framework 安全性

请参见

参考

IVsDataExplorerConnectionManager 接口

Microsoft.VisualStudio.Data.Services 命名空间