DataConnectionFactory.CreateDataConnection Method
Creates a new instance of the DataConnection class with the specified connection information.
Namespace: Microsoft.VisualStudio.Data
Assembly: Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)
Syntax
'Declaración
Public Function CreateDataConnection ( _
provider As Guid, _
connectionString As String, _
encryptedString As Boolean _
) As DataConnection
public DataConnection CreateDataConnection(
Guid provider,
string connectionString,
bool encryptedString
)
public:
DataConnection^ CreateDataConnection(
Guid provider,
String^ connectionString,
bool encryptedString
)
member CreateDataConnection :
provider:Guid *
connectionString:string *
encryptedString:bool -> DataConnection
public function CreateDataConnection(
provider : Guid,
connectionString : String,
encryptedString : boolean
) : DataConnection
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. Specifies true if encrypted.
Return Value
Type: Microsoft.VisualStudio.Data.DataConnection
Returns a specified DataConnection
object instance.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The cconnectionString parameter is null. |
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.
Nota
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.