Select to view content in your preferred language

Unable to query feature layer

871
3
09-29-2010 10:56 AM
DuaneAnderson
Emerging Contributor
I am unable to query my feature layer using the query task function.  However, if I use the Ctrl-Click function on the url, I am able to perform queries with results from the server rest endpoint. Are there any limitations, i.e. number of records returned?  What is the syntax for retrieving ALL records from the feature layer?
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
When you say you are unable to query your feature layer - does your query ever get completed? Can you also subscribe to failed event?  Can you also check that the parameters you set when performing the query through the browser (outside SL) are the same parameters you set in your SL app?
         queryTask.ExecuteCompleted += QueryTask_ExecuteCompleted;
         queryTask.Failed += QueryTask_Failed;


As far as limitation in the number of records returned by a service; the default is 500 for ArcGIS Server 9.3.1, 1000 for ArcGIS Server 10, 1000 for MapIt... as mentioned here:http://help.arcgis.com/en/webapi/silverlight/help/creating_featurelayer.htm
0 Kudos
DuaneAnderson
Emerging Contributor
Jennifer:  From the 'query layer' option at the rest endpoint, I am NOT able to query for ALL records.  I am required to limit with a WHERE clause, e.g. ICRType = 'ASSAULT'.  If ICRType is not NULL, the query stops at the limit of 500, but does return records.  Unfortunately, I cannot paste/enter this into the WHERE clause, e.g. ICRType = 'ASSAULT' without receiving a 'not declared' error message.  So, no I do not think it's completing in any fashion.  Thank you for responding and I look forward to whatever advice you can provide.  Duane
0 Kudos
JenniferNery
Esri Regular Contributor
If you wish to return all records, you can update your query's Where clause to "1=1". This is similar to performing the query outside of SL, through the browser like so:
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/LandusePlanning/M...
0 Kudos