Freigeben über


IVsDataConnectionManager Interface

Represents a shared set of data connection objects that are created on demand and managed by Visual Studio.

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

Syntax

'Declaration
<GuidAttribute("42503C6C-3D54-4986-BC13-AE6855CE89B8")> _
Public Interface IVsDataConnectionManager
[GuidAttribute("42503C6C-3D54-4986-BC13-AE6855CE89B8")]
public interface IVsDataConnectionManager
[GuidAttribute(L"42503C6C-3D54-4986-BC13-AE6855CE89B8")]
public interface class IVsDataConnectionManager
[<GuidAttribute("42503C6C-3D54-4986-BC13-AE6855CE89B8")>]
type IVsDataConnectionManager =  interface end
public interface IVsDataConnectionManager

Methods

  Name Description
Public method GetConnection(Guid, String, Boolean) Retrieves an existing data connection or creates a new data connection that matches the specified provider GUID and connection string.
Public method GetConnection(Guid, String, Boolean, Boolean) Retrieves an existing data connection or creates a new data connection that matches the specified provider GUID and connection string. Also, optionally updates the connection string of the returned connection.
Public method InvalidateConnection(IVsDataConnection) Removes the specified data connection if it exists and is a weak reference.
Public method InvalidateConnection(Guid, String, Boolean) Removes the specified data connection if it exists and is a weak reference.
Public method IsManaging(IVsDataConnection) Indicates whether the connection manager is managing the specified data connection.
Public method IsManaging(Guid, String, Boolean) Indicates whether the connection manager is managing the data connection specified by the provider, the connection string, and the encrypted connection string.

Top

Remarks

Because of the architecture of VSPackages and the Visual Studio services model, it is difficult to pass objects, such as data connections, that one would typically use globally. Normally, an application makes a single connection to a database and then uses it throughout. In Visual Studio, different features are implemented in different VSPackages, so the only way to connect features is by using Visual Studio services.

If one feature, for example Server Explorer, creates a connection for use at design time, and another feature, for example the Data Source Wizard or Dataset Designer, wants to use this connection, these latter features need a way to access the connection that was created in Server Explorer.

The Data Connection Manager lets you share these connections, so long as the client has a way to identify the connection. This identifying information is a DDEX provider GUID and a connection string.

A typical Data Connection Manager scenario is implementing drag and drop operations, where the Clipboard object is created with the DDEX provider and connection string information and the code accepting the drop uses this information to look up a matching connection.

A designer is typically expected to pass DDEX provider and connection string information; then, when it needs to use a connection for design-time purposes, it calls into the Data Connection Manager to retrieve a connection by using the information.

The Data Connection Manager is a globally registered Visual Studio service.

See Also

Reference

Microsoft.VisualStudio.Data.Services Namespace

IVsDataConnection

IVsDataConnectionFactory