Programatically delete jobs and associated triggers in Quartz.NET

Chris picture Chris · Oct 22, 2010 · Viewed 9.9k times · Source

I need a way to allow administrators to delete a job in Quartz.NET. Are there any built in methods for the JobDetail class that allow me delete the job and all associated triggers?

Answer

Paul U picture Paul U · Oct 27, 2010

you have to delete the job via the scheduler.

// First we must get a reference to a scheduler
ISchedulerFactory sf = new StdSchedulerFactory(properties);
IScheduler sched = sf.GetScheduler();

sched.DeleteJob(JobName, JobGroup);