All docs
V19.2
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

DashboardDesigner.AsyncValidateCustomSqlQuery Event

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

Namespace: DevExpress.DashboardWin

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

Declaration

public event ValidateDashboardCustomSqlQueryEventHandler AsyncValidateCustomSqlQuery
Public Event AsyncValidateCustomSqlQuery As ValidateDashboardCustomSqlQueryEventHandler

Event Data

The AsyncValidateCustomSqlQuery event handler receives an argument of the ValidateDashboardCustomSqlQueryEventArgs type. 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.

Remarks

This event occurs before executing a CustomSqlQuery contained 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.

You can handle this event to check the validity of the custom SQL query, set the e.Valid flag, and specify the e.ExceptionMessage text.

TIP

You can set the static SqlDataSource.DisableCustomQueryValidation property to true to disable the built-in security validation, although this is not recommended. In this situation, handle the validation event to process queries at your own discretion. The initial e.Valid value is always true.

Implements

DevExpress.DashboardWin.Native.IClientSideApi.AsyncValidateCustomSqlQuery
See Also