Attribute Query Task Question

1655
11
11-01-2010 10:53 AM
ChristineZeller
New Contributor III
I'm trying to implement the Attribute Query example from the SDK and I can get it working on my machine "as is" but when I change over to a layer that I'm servering it doesn't work. Also if I change the example to just use a different field like STATE_ABBR instead of STATE_NAME I have the same problem....it breaks!  Am I missing a change?

Thanks
Christine
0 Kudos
11 Replies
ChaitanyaPathak
New Contributor
Hello Everyone,
I am new to ArcGIS and would like to know if there is any way where in I can query the attribute table (particularly a field) which has number for example (1,1,2,2,2,4,4,4,4,4,4,5,6,6,6) and I want to know all the fields which has more than one repetation of numbers. In above example I really don't care about number 5 because its occuring only once. Reponse in this regard would be highly appreciated.
Thank you
0 Kudos
JenniferNery
Esri Regular Contributor
The Where property of a Query is any legal SQL Where clause as been said here: http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Quer...

So I don't think you can get repeating values by updating the query alone.  You can probably use System.Linq query on the results.

Please don't hold me accountable for the syntax 🙂 but I think it's something like this:
var repeatingValues = from g in args.FeatureSet.Features
group g by g.Attributes["FieldName"] into f
where f.Count() > 1
select f.Key;
0 Kudos