Find query problems

593
4
09-19-2011 06:49 AM
JerryBiedenbender
New Contributor
Hello,

   I am trying to use the Find query from the silverlight samples. http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Find

After updating to code to search against my service I am getting search results but when I click on the result to make it highlighted on the screen I get an error.

any help would be appreciated.

See attached

Thanks,
Jerry
0 Kudos
4 Replies
DarinaTchountcheva
Occasional Contributor II
Jerry,

Have you tried adding:

findParameters.ReturnGeometry = true;

somewhere before:

findTask.ExecuteAsync(findParameters);


The default is "true" in this version of the API, but I cannot recall what it was in previous versions.
It looks like your Shape attributes come back null, so give it a try.

Good Luck!
0 Kudos
JerryBiedenbender
New Contributor
I added the code and it is still doing the same thing. Any other ideas?

Jerry
0 Kudos
JerryBiedenbender
New Contributor
I tested it with a couple other esri services and they worked just fine as well. Its just my services, My services will query and get results but when I click on the result to get the feature highlighted, the error occures.
0 Kudos
DarinaTchountcheva
Occasional Contributor II
Jerry,

Can you debug and find out which object is null?
Is it "graphic" or the Shape attribute? While debugging, check to see what is the value of findResult.LayerName if you are searching multiple layers. It could be only one layer causing the error.

Also, you could go to your service in the REST Services directory, and perform Find there.

http://yourservername/arcgis/rest/services/yourmapservicename

Scroll all the way down to the page and click on Find. Use the API Reference link in the upper right corner to see what parameters you need to provide.

See if you get geometry back when Return Geometry is true. 
Make sure that all layers you are searching have the Shape field (to see the fields of each layer go to the above page and click on each layer link to see their metadata).

Good Luck!
0 Kudos