Esempio n. 1
0
    public static IVsDataConnectionProperties CreateConnectionProperties(
        IVsDataProvider provider)
    {
        IVsDataConnectionProperties connProperties = null;

        try
        {
            connProperties = provider.CreateObject <IVsDataConnectionProperties>();
        }
        catch (DataProviderException e)
        {
            MessageBox.Show(e.Message);
        }
        return(connProperties);
    }
Esempio n. 2
0
    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");
    }