DataConnectionManager.GetDataConnection Method (Guid, String, Boolean)
Retrieves a data connection that is equivalent to the specified connection information.
Namespace: Microsoft.VisualStudio.Data
Assembly: Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)
Syntax
'Declaration
Public Function GetDataConnection ( _
provider As Guid, _
connectionString As String, _
encryptedString As Boolean _
) As DataConnection
public DataConnection GetDataConnection(
Guid provider,
string connectionString,
bool encryptedString
)
public:
DataConnection^ GetDataConnection(
Guid provider,
String^ connectionString,
bool encryptedString
)
member GetDataConnection :
provider:Guid *
connectionString:string *
encryptedString:bool -> DataConnection
public function GetDataConnection(
provider : Guid,
connectionString : String,
encryptedString : boolean
) : DataConnection
Parameters
provider
Type: System.GuidDDEX provider GUID.
connectionString
Type: System.StringDDEX provider connection string.
encryptedString
Type: System.BooleanIndication whether the connection string information is encrypted (true if encrypted.)
Return Value
Type: Microsoft.VisualStudio.Data.DataConnection
Returns a DataConnection object instance representing the requested connection.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The connectionString parameter is null. |
ArgumentException | The specified provider is not a registered DDEX provider. |
Remarks
This method searches the current set of managed data connections for one whose connection properties are equivalent to the specified connection information. If a connection is found, it is returned. If a connection is not found, a new one is created and the new one is returned.
The state of the returned connection is undefined; it remains in the same state that was previously left by another client.
.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.