Select to view content in your preferred language

Query Attributes Tool No longer works with SL 2.0 and ArcGIS 10.0 REST

2024
3
08-23-2010 08:41 AM
BrockTerry
Emerging Contributor
I've noticed that the "Query Attributes" tool is throwing an error when I tie the tool to a ArcGIS 10 REST service.  If I point the code at a 9.3.1 REST service it works fine.

The project will build with no errors but when I use the tool and select an attribute it stops at this line of code in the .cs page:

// Zoom to selected feature (define expand percentage)
                ESRI.ArcGIS.Client.Geometry.Envelope selectedFeatureExtent = selectedFeature.Geometry.Extent;
0 Kudos
3 Replies
BrockTerry
Emerging Contributor
This is the error that I get:

System.NullReferenceException was unhandled by user code
  Message=Object reference not set to an instance of an object.
  StackTrace:
       at Standard.MainPage.QueryTask_ExecuteCompleted(Object sender, QueryEventArgs args)
       at ESRI.ArcGIS.Client.Tasks.QueryTask.OnExecuteCompleted(QueryEventArgs args)
       at ESRI.ArcGIS.Client.Tasks.QueryTask.request_Completed(Object sender, RequestEventArgs e)
       at ESRI.ArcGIS.Client.Tasks.TaskBase.request_Completed(Object sender, RequestEventArgs e)
       at ESRI.ArcGIS.Client.WebRequest.OnComplete(RequestEventArgs args)
       at ESRI.ArcGIS.Client.WebRequest.downloadStringCompleted(Object sender, DownloadStringCompletedEventArgs e)
       at System.Net.WebClient.OnDownloadStringCompleted(DownloadStringCompletedEventArgs e)
       at System.Net.WebClient.DownloadStringOperationCompleted(Object arg)
  InnerException:
0 Kudos
BrianGustafson
Occasional Contributor
Try explicitly setting the return geometry = true in your query parameters.  Is your selected features geometry attribute null?
0 Kudos
BrockTerry
Emerging Contributor
That did the trick!

Thanks so much.
0 Kudos