dashboard-devexpress-dot-dashboardwin-dot-dashboarddesigner-c73013fd.md
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
public event ValidateDashboardCustomSqlQueryEventHandler AsyncValidateCustomSqlQuery
Public Event AsyncValidateCustomSqlQuery As ValidateDashboardCustomSqlQueryEventHandler
The AsyncValidateCustomSqlQuery event's data class is ValidateDashboardCustomSqlQueryEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| ConnectionName | Gets the name of the connection to the data source containing a custom SQL query. |
| ConnectionParameters | Gets parameters used to establish a connection to the data source containing a custom SQL query. |
| CustomSqlQuery | Gets the custom SQL query that should be checked. |
| DataSourceComponentName | Gets or sets the component name of the data source for which the event was raised. |
| DataSourceName | Gets or sets the name of the data source for which the event was raised. |
| ExceptionMessage | Gets or sets the exception message returned after custom SQL query validation. |
| Valid | Gets or sets whether the current custom SQL query is valid. |
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:
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:
true. The DashboardSqlDataSource class exposes the DisableCustomQueryValidation property.ValidateCustomSqlQuery event to manage validation of custom SQL queries. Override the value of the ValidateCustomSqlQueryEventArgs.Valid flag and corresponding ValidateCustomSqlQueryEventArgs.ExceptionMessage message. Be careful when you set the e.Valid option to true because this setting skips the default validation.See Also