43429members
217967posts

[Imported] ClearScada.Client.Advanced.IQuery.ExecuteAsync

Highlighted
Sisko

[Imported] ClearScada.Client.Advanced.IQuery.ExecuteAsync

>>Message imported from previous forum - Category:Scripts and Tips<<
User: mchartrand, originally posted: 2018-10-25 18:44:38 Id:270
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.

_______

**_Andy:
I am looking for some example code of how to use the following method:
ClearScada.Client.Advanced.IQuery.ExecuteAsync
I have successfully used the following method:
ClearScada.Client.Advanced.IQuery.ExecuteSync
I do not understand how to access the QueryProgressEventArgs or QueryCompleteEventArgs from the event handlers.
Can anyone provide an example please?
For reference I have a question on Stack Overflow with full details:
[https://stackoverflow.com/questions/47071810/how-to-access-custom-eventargs-properties](https://stac... "https://stackoverflow.com/questions/47071810/how-to-access-custom-eventargs-properties")_**

__________________

bevanweiss:
The QueryProgressEventArgs I expect will only be a % complete indication unless you've called the ExecuteAsync with the ClearScada.Client.Advanced.QueryExecuteOptions.ReturnIncrementalData option.
Even then it's likely this isn't implemented, but is intended for the future...

I haven't tried using the Async methods.
If it really got down to it, you could always try doing a deep copy of the object into something else within your actual process and then setting a breakpoint after the query completes to inspect what was returned with each callback.

I would have expected the QueryCompleteEvent to work, and to return the Result within the Result member (as long as the Exception isn't indicating a problem). Is this not the case?

________________________

**_Andy:
Thanks for your response. I have done some further testing and updated my Stack Overflow question:
[https://stackoverflow.com/questions/47071810/how-to-access-custom-eventargs-properties](https://stac... "https://stackoverflow.com/questions/47071810/how-to-access-custom-eventargs-properties")
The QueryProgressEventArgs seems to show the same messages as the query list view in ViewX:
Searched x records | Created x of y records | Fetching result set
I have exactly the same issue with the QueryCompleteEventArgs as I have with the QueryProgressEventArgs as described in the Stack Overflow question.
Everything seems to work I just can't access the progress or result._**