DashboardExporter.ConnectionError Event
Allows you to detect an error when connection parameters do not allow you to connect to a data store.
Namespace: DevExpress.DashboardCommon
Assembly: DevExpress.Dashboard.v24.1.Core.dll
NuGet Package: DevExpress.Dashboard.Core
Declaration
Event Data
The ConnectionError event's data class is DashboardExporterConnectionErrorEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Cancel | Gets or sets whether the operation performed on the processed event should be canceled. Inherited from ConnectionErrorEventArgs. |
ConnectionName | Gets the name of the connection for which the event has been raised. Inherited from ConfigureDataConnectionEventArgs. |
ConnectionParameters | Gets or sets parameters used to establish a connection to data. Inherited from ConfigureDataConnectionEventArgs. |
DataSourceName | Gets the data source’s name for which the event is raised. |
Exception | Gets an exception that caused the ConnectionError event. Inherited from ConnectionErrorEventArgs. |
Handled | Gets or sets whether default actions are required to connect to a data store. Inherited from ConnectionErrorEventArgs. |
Remarks
The following code snippet handles the ConnectionError
event to detect and display errors when current connection parameters do not allow you to connect to a data store:
"The following error occurs in {e.DataSourceName}: {e.Exception.Message}"
using DevExpress.DashboardCommon;
namespace DashboardExporterApp {
class Program {
//...
DashboardExporter exporter = new DashboardExporter();
exporter.ConnectionError += Exporter_ConnectionError;
//...
static void Exporter_ConnectionError(object sender,
DashboardExporterConnectionErrorEventArgs e) {
Console.WriteLine(
$"The following error occurs in {e.DataSourceName}: {e.Exception.Message}");
}
}
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the ConnectionError event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.