c# - SQL Job Status in Winforms -
i have created windows application triggers sql job start on sql server. how have written code trigger job.
sqlcommand execjob = new sqlcommand(); execjob.connection = sqlconn; execjob.commandtype = commandtype.storedprocedure; execjob.commandtext = "msdb.dbo.sp_start_job"; execjob.parameters.addwithvalue("@job_name", "dataimport"); sqlconn.open(); execjob.executenonquery(); it runs fine , completes in 40 seconds. not want enable functions in program until job completed successfully. know how can this?
here can find post shows how status of sql jobs.
how can determine status of job?
then, need define timer pools database , request job status.
Comments
Post a Comment