Back to Devexpress

DashboardViewer.AsyncValidateCustomSqlQuery Event

dashboard-devexpress-dot-dashboardwin-dot-dashboardviewer-5ee1354d.md

latest5.1 KB
Original Source

DashboardViewer.AsyncValidateCustomSqlQuery Event

Allows you to validate a custom SQL query of the DashboardSqlDataSource in asynchronous mode.

Namespace : DevExpress.DashboardWin

Assembly : DevExpress.Dashboard.v25.2.Win.dll

NuGet Package : DevExpress.Win.Dashboard

Declaration

csharp
public event ValidateDashboardCustomSqlQueryEventHandler AsyncValidateCustomSqlQuery
vb
Public Event AsyncValidateCustomSqlQuery As ValidateDashboardCustomSqlQueryEventHandler

Event Data

The AsyncValidateCustomSqlQuery event's data class is ValidateDashboardCustomSqlQueryEventArgs. The following properties provide information specific to this event:

PropertyDescription
ConnectionNameGets the name of the connection to the data source containing a custom SQL query.
ConnectionParametersGets parameters used to establish a connection to the data source containing a custom SQL query.
CustomSqlQueryGets the custom SQL query that should be checked.
DataSourceComponentNameGets or sets the component name of the data source for which the event was raised.
DataSourceNameGets or sets the name of the data source for which the event was raised.
ExceptionMessageGets or sets the exception message returned after custom SQL query validation.
ValidGets or sets whether the current custom SQL query is valid.

Remarks

This event occurs before a CustomSqlQuery is executed. Custom Queries are stored in the Queries collection of the DashboardSqlDataSource.

The event fires for each custom SQL query in the following cases:

  • The control loads a dashboard that gets data from a custom SQL query.
  • The control’s ReloadData method forces the DashboardSqlDataSource to update its data.

Note

For security reasons, only SELECT queries are allowed and valid. If the custom query contains statements other than SELECT, or the query is specified incorrectly, the e.Valid property is set to false. The e.ExceptionMessage property contains the text specified by the DataAccessStringId.CustomSqlQueryValidationException value.

If necessary, you can disable query validation and allow users to include other statements in addition to SELECT statements in SQL queries. To accomplish this, follow the steps below:

Implements

AsyncValidateCustomSqlQuery

See Also

Asynchronous Mode

DashboardViewer Class

DashboardViewer Members

DevExpress.DashboardWin Namespace