Log In
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Chart Control
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Data Editors
  [Expand]Spell Checker
  [Collapse]Query Builder
   [Collapse]Getting Started
     Lesson 1 - Add a Query Builder to a Web Application
     Lesson 2 - Use the Resulting Query
   [Expand]Visual Elements
    Binding to Data
    Obtaining the Resulting Query
    Localize the Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Report Server
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Lesson 1 - Add a Query Builder to a Web Application

This lesson will teach you how to add a Query Builder to an ASP.NET Web Forms application.

To get started with this tutorial, create a new ASP.NET Web Forms application containing one Web Form. To add a Query Builder to the created web application, do the following.

  1. Select the default Web Form in the Solution Explorer and click the Design button to open the visual designer for this Web Form.

  2. Expand the DX.17.2: Data and Analytics Toolbox group and drop the ASPxQueryBuilder control onto the page.

  3. Next, provide the Query Builder with a data connection required to automatically obtain database schema information and properly generate data provider-specific SQL. To achieve this, add an XPO connection string for your database to the application's Web.config file.

    Pass the name of the added connection string to the Query Builder's ASPxQueryBuilder.OpenConnection method on the Page_Load event as shown in the code sample below.

  4. In the application's Web.config file, add the "resources" section as shown below.

    Alternatively, to avoid automatic loading of any libraries by a control (e.g., when such libraries are already referenced on the web page), declare an empty "resources" section and manually attach DevExtreme resources and the required third-party libraries (such as jQuery and Globalize) to the web page.

    Deleting the DevExpress "resources" section from the Web.config file will enable the default behavior (with automatic loading only of DevExtreme, without adding third-party libraries).

    To learn more about this configuration, see Embedding Third-Party Libraries.

  5. Run your web application to view the result. Use drag-and-drop to add a data table from the Tables List to the current query.

    Enable check boxes for data rows that you want to include into the query.

    Click the Preview Results () toolbar command to preview the results of the query execution.

Expanded See Also

Is this topic helpful?​​​​​​​