Dưới đây là một ví dụ chuyển thể cấu hình chương trình từ ví dụ 13 Quartz.NET của :
NameValueCollection properties = new NameValueCollection();
properties["quartz.scheduler.instanceName"] = "TestScheduler";
properties["quartz.scheduler.instanceId"] = "instance_one";
properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz";
properties["quartz.jobStore.useProperties"] = "true";
properties["quartz.jobStore.dataSource"] = "default";
properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
// if running MS SQL Server we need this
properties["quartz.jobStore.lockHandler.type"] = "Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz";
properties["quartz.dataSource.default.connectionString"] = "Server=(local);Database=quartz;Trusted_Connection=True;";
properties["quartz.dataSource.default.provider"] = "SqlServer-20";
// First we must get a reference to a scheduler
ISchedulerFactory sf = new StdSchedulerFactory(properties);
IScheduler sched = sf.GetScheduler();
Bạn cũng có thể đạt được điều tương tự với ứng dụng dựa trên tệp thuộc tính roach (tệp .config).
Nguồn
2009-09-29 12:35:00
Có một số thông tin khác về điều này tại đây: http://stackoverflow.com/questions/3821804/ado-net-with-quartz-net/21786658#21786658 –