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.GuidThe unique identifier of a DDEX provider.
connectionString
Type: System.StringAn unencrypted or encrypted string containing connection information.
encryptedString
Type: System.BooleanIndicates 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.