Compartir a través de


DataConnection Class

Supports a connection to a data source.

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

Syntax

Public MustInherit Class DataConnection _
    Inherits ServiceProvider _
    Implements ICloneable, IDisposable

Dim instance As DataConnection
public abstract class DataConnection : ServiceProvider, ICloneable, 
    IDisposable
public ref class DataConnection abstract : public ServiceProvider, 
    ICloneable, IDisposable
public abstract class DataConnection extends ServiceProvider implements ICloneable, IDisposable

Remarks

This class provides basic communication with a data source, supporting capabilities such as opening and closing connections. It also provides access to a set of services that expose more specific functionality against the data source.

DDEX provides the single implementation of this class; no data provider should provide their own implementation of the DataConnection class. Instead, DDEX Providers should implement the DataConnectionSupportclass, which is then wrapped by the DataConnection instance.

The benefit of this approach is that it allows DDEX to provide a key feature to both client and data provider: locking of the connection so that multiple clients can share the same connection and yet not create conflicts. With this architecture, clients do not need to worry about conflicting with one another, and data providers do not need to worry about multithreaded access.

The DataConnection class achieves this level of locking by serving as a proxy object for the DataConnectionSupportclass instance, as well as by providing proxy objects for each known DDEX service available from the connection. These proxies implement each method and property by locking the connection, then calling the data provider's implementation, then unlocking the connection.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Data.ServiceProvider
    Microsoft.VisualStudio.Data.DataConnection

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

DataConnection Members

Microsoft.VisualStudio.Data Namespace

ICloneable

IDisposable