Back to Devexpress

ConnectionErrorEventArgs Class

corelibraries-devexpress-dot-dataaccess-dot-sql-d182e630.md

latest3.4 KB
Original Source

ConnectionErrorEventArgs Class

Serves as the base for classes that provide data for the ConnectionError events.

Namespace : DevExpress.DataAccess.Sql

Assembly : DevExpress.DataAccess.v25.2.dll

NuGet Package : DevExpress.DataAccess

Declaration

csharp
public class ConnectionErrorEventArgs :
    ConfigureDataConnectionEventArgs
vb
Public Class ConnectionErrorEventArgs
    Inherits ConfigureDataConnectionEventArgs

ConnectionErrorEventArgs is the data class for the following events:

LibraryRelated API Members
Cross-Platform Class LibraryEFDataSource.ConnectionError
SqlDataSource.ConnectionError
DashboardDashboardOlapDataSource.ConnectionError

Remarks

The Cancel property specifies whether the operation performed on the processed event should be canceled. This option does not have any effect in the WPF and Web Dashboard controls. Only the WinForms Dashboard Designer and Viewer use it to cancel displaying the Connection Error dialog.

The Handled property indicates whether the event was handled. Set the property to true after you modify connection parameters in this event to connect with these new parameters. This property also cancels the default connection error message. You can display your custom dialog in case of a connection error and allow end users to change connection parameters.

The following example shows how to handle ConnectionError event for a WPF Dashboard Control:

cs
private void dashboardControl_ConnectionError(object sender, ConnectionErrorWpfEventArgs e) {
    // Display your custom connection dialog
    // ...

    e.ConnectionParameters = new ExcelDataSourceConnectionParameters(@"C:/Temp/ExcelWorkbook.xlsx");
    e.Handled = true;
}

Inheritance

Object EventArgs ConfigureDataConnectionEventArgs ConnectionErrorEventArgs ConnectionErrorWebEventArgs

DashboardConnectionErrorEventArgs

ConnectionErrorWpfEventArgs

DashboardExporterConnectionErrorEventArgs

See Also

ConnectionErrorEventArgs Members

DevExpress.DataAccess.Sql Namespace