Quartz Scheduler无法初始化DataSource:myDS

时间:2018-02-19 15:16:25

标签: c# quartz-scheduler

我正在使用Quartz 3.0.2和MS SQL Server。我收到“无法初始化DataSource:myDS。提供程序'SqlServer-20'没有元数据信息'\ r \ n \参数名称:providerName。”在GetScheduler。

这是我的代码:

StdSchedulerFactory schedFact = new StdSchedulerFactory();
IScheduler scheduler = await schedFact.GetScheduler();

这是我的web.config

<configSections>
<section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<quartz>
<add key="quartz.scheduler.instanceName" value="DefaultQuartzScheduler" />
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
<add key="quartz.threadPool.threadCount" value="1" />
<add key="quartz.threadPool.threadPriority" value="Normal" />
<add key="quartz.jobStore.misfireThreshold" value="60000" />
<add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" />
<add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz" />
<add key="quartz.jobStore.tablePrefix" value="QRTZ_" />
<add key="quartz.jobStore.dataSource" value="myDS" />
<add key="quartz.dataSource.myDS.connectionString" value="Data Source=.;integrated security=true;Initial Catalog=mudatabase;MultipleActiveResultSets=True;Trusted_Connection=True" />
<add key="quartz.dataSource.myDS.provider" value="SqlServer-20" />
</quartz>

1 个答案:

答案 0 :(得分:0)

我应该将我的提供程序更改为SqlServer

所以我的最终配置是

<configSections>
<section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<quartz>
<add key="quartz.scheduler.instanceName" value="DefaultQuartzScheduler" />
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
<add key="quartz.threadPool.threadCount" value="1" />
<add key="quartz.threadPool.threadPriority" value="Normal" />
<add key="quartz.serializer.type" value="binary" />
<add key="quartz.jobStore.misfireThreshold" value="60000" />
<add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" />
<add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz" />
<add key="quartz.jobStore.tablePrefix" value="QRTZ_" />
<add key="quartz.jobStore.dataSource" value="myDS" />
<add key="quartz.dataSource.myDS.connectionString" value="Data Source=.;integrated security=true;Initial Catalog=mudatabase;MultipleActiveResultSets=True;Trusted_Connection=True" />
<add key="quartz.dataSource.myDS.provider" value="SqlServer" />
</quartz>