IVsDataExplorerConnectionManager.AddConnection Method

Adds a new data connection with the specified properties.

Namespace:  Microsoft.VisualStudio.Data.Services
Assembly:  Microsoft.VisualStudio.Data.Services (in Microsoft.VisualStudio.Data.Services.dll)

Syntax

声明
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

Parameters

  • connectionName
    Type: System.String
    The name of the data connection.
  • provider
    Type: System.Guid
    The GUID of the DDEX provider.
  • connectionString
    Type: System.String
    The connection string, in unencrypted or encrypted form, containing the connection properties.
  • encryptedString
    Type: System.Boolean
    A Boolean value indicating whether the connectionString parameter is encrypted (true) or not (false).

Return Value

Type: Microsoft.VisualStudio.Data.Services.IVsDataExplorerConnection
An IVsDataExplorerConnection object representing the new data connection.

Remarks

When you create a new connection, the name of the data connection in the Visual Studio Server Explorer is by default a composite string consisting of the server name, database name, and schema. However, you can supply a custom name for the data connection. This method allows you to set the data connection name.

.NET Framework Security

See Also

Reference

IVsDataExplorerConnectionManager Interface

Microsoft.VisualStudio.Data.Services Namespace