I'd set the command.timeout to something really long, then I'd either use an
IAsyncResult or a thread (effectively the same thing in this context) to
spin that off to another thread so it won't interrupt the user. As far as
he's concerned it's done and over with. The only possible trouble you might
get into is if they close the app while the process is still running but
that's not difficult to work around. Depending on how you are calling your
function, IAsyncResult or explicitly creating a thread are both fairly
simple to implement, but multithreaded programming isn't. If you're going
to do this, the stuff I wrote here
http://www.knowdotnet.com/articles/delegates.html will get you through it,
but I don't want to give the impression that this is all you need to konw
about threading..it's a quite complex subject and can cause some major
drama - it's definitely not something to take lightly. However don't let
that scare you. I'm babbling, never mind. Mainly just remember that
anything you refer to in your thread shouldn't be referenced in the rest of
your program. If you had a sequence like this
int i = CallToLongRunningProcess;
MessageBox.Show("Whatever");
Normally you wouldn't hit the message box line until
CallToLongRunningProcess returned. However if you use a thread, it would
hit almost immediately. This can allow for a much more responsive UI and as
far as the user is concerned the call has no bearing on how they use the
app.
I've probably just throughly confused you if you aren't familiar with
threading, and if so, please feel free to ask me anything you want to know.
Sorry if I did ;-)
Bill
--
W.G. Ryan MVP Windows - Embedded
http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/
DJONES said:
Thank you for the reply! Is there anyway I can bypass the wait time
altogether? The end user would not want to wait for the job to complete
since the DTS job will email them once it has completed.