Back to Devexpress

XRDesignMdiController.ValidateCustomSql Event

xtrareports-devexpress-dot-xtrareports-dot-userdesigner-dot-xrdesignmdicontroller-b64f4628.md

latest3.2 KB
Original Source

XRDesignMdiController.ValidateCustomSql Event

Occurs when a custom SQL query is validated.

Namespace : DevExpress.XtraReports.UserDesigner

Assembly : DevExpress.XtraReports.v25.2.Extensions.dll

NuGet Package : DevExpress.Win.Reporting

Declaration

csharp
public event EventHandler<ValidateSqlEventArgs> ValidateCustomSql
vb
Public Event ValidateCustomSql As EventHandler(Of ValidateSqlEventArgs)

Event Data

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

PropertyDescription
ConnectionParametersProvides access to settings used to establish the current data connection.
MessageSpecifies the error message to display if query validation fails.
SqlContains the SQL query to validate.
ValidSpecifies whether the query is valid.

Remarks

This event is raised when a user enters a custom SQL query in the Report Designer’s Query Builder UI. Use this event when you want to control/validate custom SQL queries entered by the user. Define your custom query validation logic in the event handler as follows:

  1. Select the Report Designer’s XRDesignMdiController in the component tray:

  2. Handle the XRDesignMdiController.ValidateCustomSql event:

  3. In the event handler, define your custom query validation logic:

To validate custom SQL for all queries created in an End-User Report Designer for WinForms, handle the SqlDataSource.ValidateCustomSqlQueryGlobal event.

See Also

Custom SQL Query Validation (WinForms)

Data Access Security in WinForms Applications

XRDesignMdiController Class

XRDesignMdiController Members

DevExpress.XtraReports.UserDesigner Namespace