I have below scenario, In ASP.Net application, a piece of code need to be execute whenever a 3 weeks period expire. Period's end date is stored in sql database. I am looking for possible solutions. One approach could be to set up windows service to keep pooling End date in sql server and then execute the code. would someone suggest any better approach.
Asked
Active
Viewed 794 times
3 Answers
1
You could use a scheduled task. Set it up to run every day / hour depending on your needs. It would pool the DB, check the date, and decide if it needs to continue executing. I find scheduled tasks easier to maintain as you're just creating a console app that doesn't need service code wrapped around it.

Darren Gourley
- 1,798
- 11
- 11
0
You should probably take a look to Quartz Scheduler.
Quartz can be hosted inside an ASP.NET WebApplication but you must to avoid the App Pool fall asleep by setting StartMode to AlwaysRunning and Idle-Time out to 0.

emmekappa
- 792
- 1
- 6
- 9
0
You can use hangfire and do a beutiful work done with simplicity: http://hangfire.io/
Like this:
BackgroundJob.Schedule( () => Console.WriteLine("Reliable!"), TimeSpan.FromDays(7));
Happy to Help you!

Igor Quirino
- 1,187
- 13
- 28