Hi,
Is there a document on how to cancel an excuting QueryTask properly?
I know that there is method CancelAsync(), but I want to know more if additional steps need to be done to have this done properly.
Thanks!
if (queryTask.IsBusy) queryTask.CancelAsync(); queryTask.ExecuteAsync(query);
You can call the following method: http://help.arcgis.com/en/webapi/wpf/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.TaskBase~Can...if (queryTask.IsBusy) queryTask.CancelAsync(); queryTask.ExecuteAsync(query);
Query query = new Query(); //Setup query here... QueryTask queryTask = new QueryTask(Url); queryTask.ExecuteAsync(query); QueryTask queryTask2 = new QueryTask(Url); queryTask2.Execute(query); //This one always times out after a minute or so
var query = new Query() { Where = "1=1", ReturnGeometry = true }; query.OutFields.Add("*"); var firstQT = new QueryTask("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer/0"); firstQT.Failed += (s, e) => { System.Diagnostics.Debug.WriteLine("firstQT.Failed"); }; firstQT.ExecuteCompleted += (s, e) => { System.Diagnostics.Debug.WriteLine("firstQT.ExecuteCompleted"); }; var secondQT = new QueryTask("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer/0"); secondQT.Failed += (s, e) => { System.Diagnostics.Debug.WriteLine("secondQT.Failed"); }; secondQT.ExecuteCompleted += (s, e) => { System.Diagnostics.Debug.WriteLine("secondQT.ExecuteCompleted"); }; firstQT.ExecuteAsync(query); secondQT.ExecuteAsync(query);
Does query need to be complicated?
Do both QueryTask point to the same service URL?
Have you tried sampleserver or is it service-specific perhaps?
would anyone know, is the querytask used only for http URLs or can I use it with a https URL?