DataProviderException Class

Represents the exception that occurs when there is an unexpected problem with a DDEX provider, such as missing or invalid registration or support entities.

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

Syntax

<SerializableAttribute> _
Public MustInherit Class DataProviderException _
    Inherits Exception

Dim instance As DataProviderException
[SerializableAttribute]
public abstract class DataProviderException : Exception
[SerializableAttribute]
public ref class DataProviderException abstract : public Exception
public abstract class DataProviderException extends Exception

Remarks

This exception is thrown when initial verification of DDEX provider registration by the DDEX provider manager service is successful, but on further interrogation it is discovered to be erroneous. It is also thrown when core support entities such as the IVsDataConnectionProperties interface, which are considered fundamental to a DDEX provider implementation, are not found or supported.

When this exception is thrown, a generic error message is shown to the user, indicating that there is a problem in the DDEX provider and that the provider writer should be contacted. The full error description is logged in the Windows event log.

It is not expected that clients or providers will catch and handle this exception, unless it is within a general catch block that eventually re-throws or displays the error message in a message box.

DataProviderException uses HRESULT E_UNEXPECTED, which has the value 0x8000FFFF.

Examples

The following code demonstrates the attempted creation of a DDEX support entity by using an IVsDataProvider object. If the support entity cannot be created, the code displays a message box containing an error.

using System;
using System.Windows.Forms;
using Microsoft.VisualStudio.Data.Core;
using Microsoft.VisualStudio.Data.Services.SupportEntities;

public class DdexExample
{
    public static IVsDataConnectionProperties CreateConnectionProperties(
        IVsDataProvider provider)
    {
        IVsDataConnectionProperties connProperties = null;
        try
        {
            connProperties = provider.CreateObject<IVsDataConnectionProperties>();
        }
        catch (DataProviderException e)
        {
            MessageBox.Show(e.Message);
        }
        return connProperties;
    }
}

Inheritance Hierarchy

System.Object
  System.Exception
    Microsoft.VisualStudio.Data.Core.DataProviderException

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

DataProviderException Members

Microsoft.VisualStudio.Data.Core Namespace