Query Builder is a custom web control which allows the user to build a query and verify/execute it. The web control lists all of the layers that are available on the primary map resource. When a user selects a layer, the query automatically populates the list of columns (fields) for the layer. The user can then either manually type out the query, or double click on any of the columns and enter a value for it. The query has a standard SQL query syntax (i.e. ID=1234 AND Status=’Ready’). The user has the option of validating the query, or executing it. Validating will test for any errors in the query. Executing will run the query and highlight the results.
The web control allows for certain options to be set by the developer. The important options to set are the MapBuddyId and GraphicsLayerName, the rest are optional. It also allows for highlighting properties to be set, and the maximum number of results to be set.
Usage is kept relatively simple:
1 – Add the QueryBuilder.ascx file to your project
2 – Register the control in your ASPX file:
3 – Insert the QueryBuilder control into the ASPX File (< and > are removed from the following line):
qb:QueryBuilder ID=”QueryBuilder1″ runat=”server” MapBuddyId=”Map1″ GraphicsLayerName=”Graphics”
HighlightColor=”Aqua” MaxRecords=1000 PointMarkerSize=7 PointMarkerType=”Star” PolyBoundaryColor=”black”
PolyBoundaryTransparency=35 PolyFillType=”FDiagonal” PolyTransparency=25
One warning about the control. Executing complex queries, or queries which return a large number of results, especially on fields which are not indexed, may take a long time.