Visual Studio SDK
IVsDataExplorerConnectionManager..::.AddConnection Method

Updated: November 2007

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

Visual Basic (Declaration)
Function AddConnection ( _
    connectionName As String, _
    provider As Guid, _
    connectionString As String, _
    encryptedString As Boolean _
) As IVsDataExplorerConnection
Visual Basic (Usage)
Dim instance As IVsDataExplorerConnectionManager
Dim connectionName As String
Dim provider As Guid
Dim connectionString As String
Dim encryptedString As Boolean
Dim returnValue As IVsDataExplorerConnection

returnValue = instance.AddConnection(connectionName, _
    provider, connectionString, encryptedString)
C#
IVsDataExplorerConnection AddConnection(
    string connectionName,
    Guid provider,
    string connectionString,
    bool encryptedString
)
Visual C++
IVsDataExplorerConnection^ AddConnection(
    String^ connectionName, 
    Guid provider, 
    String^ connectionString, 
    bool encryptedString
)
JScript
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.

Permissions

See Also

Reference

Page view tracker