Currently when I work with multiple queries I setup the first query and then when I add the second I add a "2" to certain parts of the code (see code below). I am new to programing and silverlight and I am thinking this might not be the most effective way to set up multiple queries. So far I have only set up multiple queries that go to separate results and displayed on separate datagrids. I am trying to setup an attribute query and from those results do a spatial query to see which of the queried polygons intersect with my address location points. I am unsure on how to integrate the attribute query and the spatial query to output to a single datagrid. Any help would be appreciated.Current multiple query code:First query: QueryTask queryTask = new QueryTask("mapserver web address");
queryTask.ExecuteCompleted += QueryTask_ExecuteCompleted;
queryTask.Failed += QueryTask_Failed;
// Bind data grid to query results
Binding resultFeaturesBinding = new Binding("LastResult.Features");
resultFeaturesBinding.Source = queryTask;
QueryDetailsDataGrid.SetBinding(DataGrid.ItemsSourceProperty, resultFeaturesBinding);
Query query = new ESRI.ArcGIS.Client.Tasks.Query();
query.OutSpatialReference = MyMap.SpatialReference;
// Specify fields to return from query
query.OutFields.AddRange(new string[] { "OBJECTID","Name", "Phone", "TTYPhone", "WebAddress", "Charge" });
query.Geometry = bestCandidate.Location;
//query.Geometry = args.Geometry;
// Return geometry with result features
query.ReturnGeometry = true;
queryTask.ExecuteAsync(query);
Second query: QueryTask queryTask2 = new QueryTask("mapserver web address");
queryTask2.ExecuteCompleted += QueryTask_ExecuteCompleted2;
queryTask2.Failed += QueryTask_Failed2;
// Bind data grid to query results
Binding resultFeaturesBinding2 = new Binding("LastResult.Features");
resultFeaturesBinding2.Source = queryTask2;
QueryDetailsDataGrid2.SetBinding(DataGrid.ItemsSourceProperty, resultFeaturesBinding2);
Query query2 = new ESRI.ArcGIS.Client.Tasks.Query();
query2.OutSpatialReference = MyMap.SpatialReference;
// Specify fields to return from query
query2.OutFields.AddRange(new string[] { "OBJECTID","Name", "Phone", "TTYPhone", "WebAddress", "Charge" });
query2.Geometry = bestCandidate2.Location;
//query.Geometry = args.Geometry;
// Return geometry with result features
query2.ReturnGeometry = true;
queryTask2.ExecuteAsync(query2);
Thanks!