Dashboard.ConnectionError Event
Allows users to override the default behavior if data store connection fails with current connection parameters.
Namespace: DevExpress.DashboardCommon
Assembly: DevExpress.Dashboard.v24.2.Core.dll
NuGet Package: DevExpress.Dashboard.Core
#Declaration
public event DashboardConnectionErrorEventHandler ConnectionError
#Event Data
The ConnectionError event's data class is DashboardConnectionErrorEventArgs. 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 Connection |
Connection |
Gets the name of the connection for which the event has been raised.
Inherited from Configure |
Connection |
Gets or sets parameters used to establish a connection to data.
Inherited from Configure |
Data |
Gets the data source name for which the event was raised. |
Exception |
Gets an exception that caused the Connection |
Handled |
Gets or sets whether default actions are required to connect to a data store.
Inherited from Connection |
The event data class exposes the following methods:
Method | Description |
---|---|
Close |
Closes the wait form. |
Show |
Shows the wait form. |
#Remarks
The ConnectionError event fires if a data store connection fails with current connection parameters (for instance, the database is inaccessible). You can handle the ConnectionError event and override the default behavior in this case.
To override the default behavior, do the following:
- Check the data source name for which the event has been raised using the DashboardConnectionErrorEventArgs.DataSourceName event parameter.
- Provide new connection parameters using the ConfigureDataConnectionEventArgs.ConnectionParameters property.
- Set the ConnectionErrorEventArgs.Handled property to true. This will cancel the default routine for providing connection parameters.
To cancel connecting to the data store, use the ConnectionErrorEventArgs.Cancel property.
To get the exception that caused the event, use the ConnectionErrorEventArgs.Exception property.