Customer Service | Training | Contact Us
You are here: Home > Downloads > ArcScripts > Search Results > Script Details Login | Feedback | Help

Execute Custom Queries And Highlight Results



contact author | download help | add bookmark | view bookmarks
Author Sasa I.
File Name QueryBuilder.zip
Language C#
Last Modified Feb 8 2007
Status of work Public Domain
Software ArcGIS Server
File Size 5.77 kb
Downloads 1421

ArcScripts is intended for the free exchange of scripts and tools related to ESRI software products. Please alert the moderator if this script is a demo, trial-version, or an advertisement for a retail product.


Summary
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:
<%@ Register Src="QueryBuilder.ascx" TagName="QueryBuilder" TagPrefix="qb" %>
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.