Skip to main content
A newer version of this page is available. .

Obtaining the Resulting Query

When an end-user clicks the Save command on the Query Builder control’s toolbar or the client-side ASPxClientQueryBuilder.Save method is called, the server-side ASPxQueryBuilder.SaveQuery event occurs. A handler receives an event argument providing access to a string containing the resulting query both as a string value and an internal representation speciffic for the DevExpress Data Access library (a SelectQuery object).


using DevExpress.DataAccess.Sql;
// ..
protected void ASPxQueryBuilder1_SaveQuery(object sender, DevExpress.XtraReports.Web.SaveQueryEventArgs e) {
    SelectQuery query = e.ResultQuery;
    string queryString = e.SelectStatement;
}

Note that a SelectQuery can be reopened in the Query Builder for further editing.


protected void Page_Load(object sender, EventArgs e) {
    ASPxQueryBuilder1.OpenConnection("NorthwindXpo", query);            
}