Quartz.NET ADO.net Database Configuration

This should be a very simple question. I created a database for Quartz.NET and filled in all the tables and stuff, now I'm just trying to configure my project to interact with the database. I can handle its part of the encoding, I just don't know which configuration file to use.

Thanks in advance!

+4
source share
1 answer

Do you have an application configuration file? if your application is windows or a Windows application, you can add the application configuration file manually (right-click the project in your solution explorer โ†’ Add new item and select โ€œApplication configuration fileโ€). It will appear as the App.Config file in your project, and when you create the project, this file will be copied to the output folder and renamed to "yourappname.exe.config".

After you have added the configuration file, you need to place the quartz configuration in this 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> 
+11
source

Source: https://habr.com/ru/post/1413804/


All Articles