Select to view content in your preferred language

Problem with QueryTask and geometry

725
3
05-17-2010 10:58 AM
SebastienPelletier
Frequent Contributor
When I perform a querytash the features result have always geometry at nothing

Code :

Dim Task As New ESRI.ArcGIS.Client.Tasks.QueryTask()
       Task.Url = "http://server/arcgis/rest/services/xxx/MapServer/8"

        Dim Query As New ESRI.ArcGIS.Client.Tasks.Query

        Query.ReturnGeometry = True
        Query.Where = txtQuery.Text

        AddHandler RequeteTask.ExecuteCompleted, AddressOf QueryComplete
        AddHandler RequeteTask.Failed, AddressOf QueryError

        Task.ExecuteAsync(Query)


Private Sub QueryComplete(ByVal sender As Object, ByVal args As ESRI.ArcGIS.Client.Tasks.QueryEventArgs)

         For Each Feature As ESRI.ArcGIS.Client.Graphic In args.FeatureSet.Features

           ' BUG here Feature.Geometry is always nothing

        Next

    End Sub
0 Kudos
3 Replies
SebastienPelletier
Frequent Contributor
I found the problem, but not the solution.

The problem occurs when my featureclass has a Global ID (UUID) field . When I delete the field everything works.
0 Kudos
dotMorten_esri
Esri Notable Contributor
If you go to the rest endpoint and execute the same query from the HTML page, do you get geometry back?
0 Kudos
SebastienPelletier
Frequent Contributor
I found the problem, the field shape was set to invisible in the mxd

Thank you
0 Kudos