IVsDataConnectionFactory.CreateConnection Method

Initializes a new instance of the IVsDataConnection class with the specified connection information.

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

Syntax

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

Parameters

  • provider
    Type: System.Guid

    The unique identifier of a DDEX provider.

  • connectionString
    Type: System.String

    An unencrypted or encrypted string containing connection information.

  • encryptedString
    Type: System.Boolean

    Indicates whether the connectionString parameter is unencrypted or encrypted. Specify true if encrypted.

Return Value

Type: Microsoft.VisualStudio.Data.Services.IVsDataConnection
A IVsDataConnection object representing a data connection.

Exceptions

Exception Condition
ArgumentNullException

The cconnectionString parameter is nulla null reference (Nothing in Visual Basic).

ArgumentException

The provider is not a registered DDEX provider.

Remarks

The caller becomes the exclusive owner of the returned data connection instance, and it is therefore the responsibility of the caller to call the Dispose method on the connection to effectively manage its resources.

Note

Other exceptions that occur indicate a provider-specific error during initialization of the provider connection object.

.NET Framework Security

See Also

Reference

IVsDataConnectionFactory Interface

Microsoft.VisualStudio.Data.Services Namespace