Select to view content in your preferred language

???Query task without map"  - From Samples (Quering a different field)

646
2
11-09-2011 07:50 AM
sairam1
Emerging Contributor
I am using the �??Query task without map" -(http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#QueryWithoutMap) from the samples - here, if I want to perform the query operation on the "Region" field instead of "State Name" field.

Could you please suggest me as what changes should I make in the code in Xaml & Xaml.cs.

Thanks for your Suggestions!
0 Kudos
2 Replies
ChrisBradberry
Deactivated User
This query depends on the map service.  There are a couple of things to do.  Change the map service to have the region as the display field, or you could add a where statement for the query in the xaml.cs.  The where statement would be query.where = Sub_Region = 'Pacific';  You could bind the where statement to a dropdown for all the regions.

The best thing to do is go to the rest endpoint and hit the query tab to make sure that you get the results that you want.

http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5
0 Kudos
JenniferNery
Esri Regular Contributor
In addition to what Chris said. You can read up on the following documentation to know the difference between query.Text and query.Where properties:
http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Quer...
http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Quer...

Query.Text operates on display field. If "Region" is not the display field, you have to use Where clause instead.
0 Kudos