Hatim
Hatim

Reputation: 493

What's the best way to implement a scheduled job using a windows service

I have a database job that runs occasionally at night and I need a windows service to poll the database regularly to do some more work after the SQL job is done. I am a looking for a solid example to write a scheduler that can fail gracefully without crashing the service.

Upvotes: 2

Views: 2255

Answers (3)

Khurram Aziz
Khurram Aziz

Reputation: 1498

Take a look at http://codeplex.com/TaskService

Upvotes: 0

Chad Grant
Chad Grant

Reputation: 45382

I would use MSMQ, add a final step to the job that adds a message to the queue (Via ActiveX Script / COM or a .net call if you can)

Then have your service monitoring the Queue.

As far as not crashing the service, that would all be up to you and error handling etc...

Upvotes: 1

Mark Ransom
Mark Ransom

Reputation: 308091

Just make it a scheduled task. See windows service vs scheduled task

Upvotes: 1

Related Questions