var repeatingValues = from g in args.FeatureSet.Features group g by g.Attributes["FieldName"] into f where f.Count() > 1 select f.Key;
TypeDescComboBox.ItemsSource = (from g in args.FeatureSet.Features select g.Attributes["TYPEDESC"]).Distinct();
int min = 32, max = 33; query.Where = string.Format("STATE_ABBR = '{0}' and MED_AGE < {1}and MED_AGE_M > {2}", QueryComboBox.SelectedItem, min, max);
query.Where = string.Format("STATE_ABBR = '{0}'", QueryComboBox.SelectedItem);
Oh I see what the problem is now. In this sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AttributeQuery (if you are using this), the query OutFields only include "STATE_NAME". The service that it's using is http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5 and "STATE_ABBR", while it is a valid field, is not included in the OutFields. You can update this line query.OutFields.AddRange(new string[] { "STATE_NAME", "STATE_ABBR" }); //or simply use * to return all fields -- query.OutFields.Add("*");
query.OutFields.AddRange(new string[] { "STATE_NAME", "STATE_ABBR" }); //or simply use * to return all fields -- query.OutFields.Add("*");
if ((args.UserState as string) == "initial") { // Just show on initial load QueryComboBox.Items.Add("Select..."); foreach (Graphic graphic in args.FeatureSet.Features) { QueryComboBox.Items.Add(graphic.Attributes["STATE_ABBR"].ToString()); } QueryComboBox.SelectedIndex = 0; return; }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.