Fereshteh Rabet
Fereshteh Rabet

Reputation: 201

Quartz Scheduler Could not Initialize DataSource: myDS

I'm using Quartz 3.0.2 with MS SQL Server. I'm getting "Could not Initialize DataSource: myDS. There is no metadata information for provider 'SqlServer-20'\r\nParameter name: providerName." on GetScheduler.

This is my code:

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

This is my 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>

Upvotes: 1

Views: 5920

Answers (2)

Rupa Mistry
Rupa Mistry

Reputation: 383

I faced a similar issue while integrating Quartz 3.3.3 with .Net Core 3.1.

For .Net Core, you need to ensure "Microsoft.Data.SqlClient" nuget is installed for Quartz to work seamlessly with SqlServer data provider.

Upvotes: 2

Fereshteh Rabet
Fereshteh Rabet

Reputation: 201

I should change my provider to SqlServer

so my final config is

<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>

Upvotes: 2

Related Questions