I'm working through a the attribute query example - http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#QueryWithoutMapBasically after I do a query I would like to instead of throwing the data in a Data Grid I would just like to loop the the results. I'm interested in one field (example in the SDK example take the field Region). When all the records are returned from the query I would like to take all the values in the Region column, grab all the values and remove the duplicates and assign it to a string. So I want to try and do something like this but it is not working on. I'm trying to get it into a list so I can but it in a long string so I can build a new query where based of the previous selection
List<DataItem> _MitListdataItems = null;
foreach (Graphic graphic in args.FeatureSet.Features)
{
//Set Distinct
//list for Mitigation List Table
_MitListdataItems.Add = (from g in args.FeatureSet.Features
orderby g.Attributes["SUB_REGION"].ToString()
select g.Attributes["SUB_REGION"]).Distinct();
}
I can do this but I don't know how to get me var list outside of my for loop I can't access it
foreach (Graphic graphic in args.FeatureSet.Features)
{
var list = (from g in args.FeatureSet.Features
orderby g.Attributes["SUB_REGION"].ToString()
select g.Attributes["SUB_REGION"]).Distinct();
}
Can someone shed some light on where I should go...I've been stuck for awhile.ThanksChristine.