DataConnectionManager Class

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

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

Syntax

<GuidAttribute("E7A0D4E0-D0E4-4afa-A8A1-DD4636073D98")> _
Public MustInherit Class DataConnectionManager _
    Implements ICollection(Of DataConnection), IEnumerable(Of DataConnection),  _
    IEnumerable

Dim instance As DataConnectionManager
[GuidAttribute("E7A0D4E0-D0E4-4afa-A8A1-DD4636073D98")]
public abstract class DataConnectionManager : ICollection<DataConnection>, 
    IEnumerable<DataConnection>, IEnumerable
[GuidAttribute(L"E7A0D4E0-D0E4-4afa-A8A1-DD4636073D98")]
public ref class DataConnectionManager abstract : ICollection<DataConnection^>, 
    IEnumerable<DataConnection^>, IEnumerable
public abstract class DataConnectionManager implements ICollection<DataConnection>, IEnumerable<DataConnection>, IEnumerable

Remarks

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

If one feature, for example the 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, they 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/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 around 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 given the information

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Data.DataConnectionManager

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

DataConnectionManager Members

Microsoft.VisualStudio.Data Namespace

DataConnection

DataConnectionFactory