Share via


DataConnectionSupport Class

Provides properties and methods that enable you to work directly with connections to a data source.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Data.ServiceProvider
    Microsoft.VisualStudio.Data.ServiceProviderWithSite
      Microsoft.VisualStudio.Data.DataConnectionSupport
        Microsoft.VisualStudio.Data.AdoDotNet.AdoDotNetConnectionSupport

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

Syntax

'Declaration
Public MustInherit Class DataConnectionSupport _
    Inherits ServiceProviderWithSite _
    Implements IDisposable
public abstract class DataConnectionSupport : ServiceProviderWithSite, 
    IDisposable
public ref class DataConnectionSupport abstract : public ServiceProviderWithSite, 
    IDisposable
[<AbstractClass>]
type DataConnectionSupport =  
    class 
        inherit ServiceProviderWithSite 
        interface IDisposable 
    end
public abstract class DataConnectionSupport extends ServiceProviderWithSite implements IDisposable

The DataConnectionSupport type exposes the following members.

Constructors

  Name Description
Protected method DataConnectionSupport Class constructor. Instantiates a nonparameterized instance of the DataConnectionSupport class.

Top

Properties

  Name Description
Public property ConnectionString Retrieves or sets a string representation of information required to establish a given data source connection.
Public property ConnectionTimeout Retrieves or sets the amount of time, in seconds, to wait to establish a connection before terminating the attempt and generating a timeout error.
Public property ProviderObject Retrieves the underlying data provider object for the specified connection.
Protected property ServiceTypes Retrieves a list of service types used to convert the unmanaged QueryService method call, in which a service GUID is specified, into a managed IServiceProvider.GetService method call, in which a managed type is specified. (Inherited from ServiceProvider.)
Public property Site Retrieves or sets the site object instance. (Inherited from ServiceProviderWithSite.)
Public property State Retrieves the state of the data connection.

Top

Methods

  Name Description
Public method Close Closes the specified connection.
Public method Dispose() Performs tasks associated with freeing, releasing, or resetting resources.
Protected method Dispose(Boolean) Performs tasks associated with freeing, releasing, or resetting resources.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Finalizes the connection. (Overrides Object.Finalize().)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetService(Guid) Retrieves a service with a specified service GUID. (Inherited from ServiceProvider.)
Public method GetService(Type) Retrieves a service of the specified type. (Inherited from ServiceProvider.)
Protected method GetServiceImpl(Type) Allows you to obtain implementation services. (Overrides ServiceProvider.GetServiceImpl(Type).)
Protected method GetServiceImpl(Guid) Provides the implementation for retrieving a service with a specific GUID. (Inherited from ServiceProvider.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Initialize Initializes the specified connection, optionally from an existing data provider object.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method OnSiteChanged Raises the SiteChanged event. (Inherited from ServiceProviderWithSite.)
Public method Open Opens the specified connection.
Protected method RaiseMessageReceived Raises the MessageReceivedevent on the enclosing DataConnection instance.
Protected method RaiseStateChanged Raises the state changed event on the enclosing DataConnection instance.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event SiteChanged Event raised when the Site property has changed. (Inherited from ServiceProviderWithSite.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IObjectWithSite.GetSite Retrieves the last site set using the IObjectWithSite.SetSite method. If there is no known site, an exception is thrown. (Inherited from ServiceProviderWithSite.)
Explicit interface implemetationPrivate method IServiceProvider.QueryService Performs as a factory for services that are exposed through an implementation of IServiceProvider. (Inherited from ServiceProvider.)
Explicit interface implemetationPrivate method IObjectWithSite.SetSite Provides a site's IUnknown pointer to a given object. (Inherited from ServiceProviderWithSite.)

Top

Remarks

The DataConnectionSupport class represents the data provider implementation to support a data connection. The DDEX architecture implements the DataConnection class by calling into a provider specific DataConnectionSupport implementation.

The properties and methods on this class provide basic functionality that allows the data provider to communicate with the data source, performing such tasks as opening and closing connections and retrieving connection state. A data provider can also expose more specialized services by overriding the GetServiceImpl method. These connection-related services are summarized following:

  • DataViewSupport: Provides a method for retrieving XML that describes data source specific views of data objects to be shown in the Visual Studio Server Explorer.

  • DataObjectSupport: Provides a method for retrieving XML that describes types of data objects supported by the data source and actions that can be performed on them.

  • DataObjectIdentifierResolver: Provides a method for resolving data object identifiers.

  • DataObjectIdentifierConverter: Provides methods for converting between string and array representations of data object identifiers.

  • DataObjectItemComparer: Provides methods for comparing data object identifier parts and property values.

  • DataCommand: Provides the ability to derive and execute various types of commands.

  • DataAsyncCommand: Enables executing data commands in an asynchronous manner.

  • DataTransaction: Provides the ability to begin, commit, and roll back transactions.

  • DataSourceVersionComparer: Provides a method for comparing two data-source-specific version strings.

  • DataSourceInformation: Provides a set of well-defined name-value pairs that describe the data source.

This class implements the IObjectWithSite interface, which allows DDEX to site a data provider's DataConnectionSupport implementation with the DataConnection object that is calling into it. This provides the implementation with context, as well as with a means for retrieving Visual Studio services.

Any derived class should implement the various abstract properties and methods to support their connection. A derived class should also override the protected GetServiceImplmethod to provide its connection services. When a state-change or message-received event occurs, a derived class should, where possible, call the protected RaiseStateChanged and RaiseMessageReceived methods, which the base class then passes on to the sited DataConnection object.

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

Microsoft.VisualStudio.Data Namespace

ServiceProviderWithSite

IDisposable