This should be a really easy question. I created the DB for Quartz.NET and populated all of the tables and stuff, now I'm just trying to configure my project to interact with the DB. I can handle the coding part of it, I just don't know what config file to use..
Thanks in advance!
Do you have an application configuration file at all? if your application is a windows forms or windows service application, you may add an Application configuration file manually (right-click the project in your solution explorer -> Add New Item and select the "Application Configuration File"). It will end up appearing as the App.Config file in your project and when you build the project, this file will be copied to the output folder and it will be renamed to "yourappname.exe.config".
Once you have added the config file, you need to put quartz configuration to that file. For instance:
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
...
other lines here
...
</configSections>
...
...
...
<quartz>
<add key="quartz.scheduler.instanceName" value="TestQuartzServer" />
<add key="quartz.scheduler.instanceId" value="instance_one" />
<add key="quartz.threadPool.threadCount" value="10" />
<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.useProperties" value="false" />
<add key="quartz.jobStore.dataSource" value="default" />
<add key="quartz.jobStore.tablePrefix" value="QRTZ_" />
<add key="quartz.jobStore.clustered" value="true" />
<add key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.SimpleSemaphore, Quartz" />
<!-- point this at your database -->
<add key="quartz.dataSource.default.connectionStringName" value="ConnectionStringName" />
<add key="quartz.dataSource.default.provider" value="SqlServer-20" />
</quartz>
...
<connectionStrings>
<add name="ConnectionStringName" connectionString="Data Source=...; etc." providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With