次の方法で共有


IVsDataProvider Interface

Provides a DDEX provider.

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

Syntax

'宣言
Public Interface IVsDataProvider
'使用
Dim instance As IVsDataProvider
public interface IVsDataProvider
public interface class IVsDataProvider
public interface IVsDataProvider

Remarks

A DDEX provider object supplies information about a provider that is registered in the Visual Studio environment. It is the entry point for DDEX clients to interact with a DDEX provider. Each provider has a unique GUID that distinguishes it from all others, in addition to a variety of names and a description. This interface supplies a set of properties that define custom characteristics of the provider, in addition to a method that retrieves localized strings when given a resource ID string that is provider-specific. It also supplies a method for determining a DDEX data source when given a connection string that contains information about the target data source. It supplies methods for identifying and creating DDEX support entities implemented by the provider. Finally, it supplies resolution methods for managed types and assemblies that are owned by the provider.

A DDEX provider object can be retrieved by using the IVsDataProviderManager service.

Examples

The following code demonstrates how a client can retrieve a specific DDEX provider and output its display name and description, and then create one of the standard DDEX support entities.

using System;
using System.Diagnostics;
using Microsoft.VisualStudio.Data.Core;
using Microsoft.VisualStudio.Data.Services.SupportEntities;

public class DDEX_IVsDataProviderExample1
{
    public static void UseDataProvider(
        IServiceProvider serviceProvider,
        Guid providerGuid)
    {
        IVsDataProviderManager providerManager =
            serviceProvider.GetService(typeof(IVsDataProviderManager))
                as IVsDataProviderManager;
        IVsDataProvider provider = providerManager.Providers[providerGuid];
        Trace.WriteLine(provider.DisplayName);
        Trace.WriteLine(provider.Description);
        IVsDataConnectionProperties connectionProperties =
            provider.CreateObject<IVsDataConnectionProperties>();
        connectionProperties.Parse("Test connection string");
    }
}

See Also

Reference

IVsDataProvider Members

Microsoft.VisualStudio.Data.Core Namespace