I have an application that when it starts up, begins a process to run a SQL Server Job transferring some data around. The user is presented with the main form and can proceed as they wish.
On this form there is an option for users to "Run Import", in effect, run the Server Job again for latest information.
If the user clicks this option right after opening the form (while the Server Job is still running) they are presented with a nasty error message about the job already running being called by "Doman/Username". Thankfully this program does not crash or anything, but the message is very startling to end-users.
Is there a way in code for me to check if this job is running? I want to provide the users with a friendlier message about waiting for the job to complete (job takes about 2 minutes).
Thanks for any help!
-A.L.
On this form there is an option for users to "Run Import", in effect, run the Server Job again for latest information.
If the user clicks this option right after opening the form (while the Server Job is still running) they are presented with a nasty error message about the job already running being called by "Doman/Username". Thankfully this program does not crash or anything, but the message is very startling to end-users.
Is there a way in code for me to check if this job is running? I want to provide the users with a friendlier message about waiting for the job to complete (job takes about 2 minutes).
Thanks for any help!
-A.L.