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.
Inheritance Hierarchy
System.Object
System.Exception
Microsoft.VisualStudio.Data.Core.DataProviderException
Namespace: Microsoft.VisualStudio.Data.Core
Assembly: Microsoft.VisualStudio.Data.Core (in Microsoft.VisualStudio.Data.Core.dll)
Syntax
'Declaration
<SerializableAttribute> _
Public MustInherit Class DataProviderException _
Inherits Exception
[SerializableAttribute]
public abstract class DataProviderException : Exception
[SerializableAttribute]
public ref class DataProviderException abstract : public Exception
[<AbstractClass>]
[<SerializableAttribute>]
type DataProviderException =
class
inherit Exception
end
public abstract class DataProviderException extends Exception
The DataProviderException type exposes the following members.
Constructors
Name | Description | |
---|---|---|
DataProviderException() | Initializes a new instance of the DataProviderException class. | |
DataProviderException(String) | Initializes a new instance of the DataProviderException class, specifying an error message. | |
DataProviderException(SerializationInfo, StreamingContext) | Initializes a new instance of the DataProviderException class with serialized data. | |
DataProviderException(String, Exception) | Initializes a new instance of the DataProviderException class, specifying an error message and a reference to the inner exception that is the cause of this exception. |
Top
Properties
Name | Description | |
---|---|---|
Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.) | |
HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.) | |
HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from Exception.) | |
InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.) | |
Message | Gets a message that describes the current exception. (Inherited from Exception.) | |
Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.) | |
StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.) | |
TargetSite | Gets the method that throws the current exception. (Inherited from Exception.) |
Top
Methods
Name | Description | |
---|---|---|
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.) | |
GetType | Gets the runtime type of the current instance. (Inherited from Exception.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.) |
Top
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;
}
}
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.