I have read and watched 1000 threads on how to do work (update progress) after a Widows form has triggered a long task. Unfortunatly the one that seems easy enough to implement (application.dowork) should not be used.
I have a VB2010 forms app, user can select a number of field then "RUN" will run a query in Oracle and return a text file of results. Some queries can be several minutes. The first line on any results is the number of hits returned.
The query application is not SQL, it is an executable that takes a number of arguments (the fields) - the RUN button kicks off a new process (sets all the start.info parameters, the args, location of the exe etc)
Once I kick off the exe I should be able to start a sub that looks for the results file to be generated, reads the first line, sets that value as progress max, periodically checks to see if it is still running and provide progress updates (the results file prints 1 result per line - so 1000 hits will generate 1001 line file - the first line is the hit count)
I see tons of hints that it can be done - where can I find pointers to set something up? Is IAsync a good choice, do I need a background worker since the executable running the query is already offloaded from the form UI?
Thanks,