Avatar of axlrules
axlrules
 asked on

C# How to create a scheduled job

Hello Experts,

I am doing a ASP.net project using C#. I want to create a scheduled job to start my application at a certain time daily to fetch data and store it in a database.
How to create the scheduled job ?

Thanks
.NET ProgrammingASP.NET

Avatar of undefined
Last Comment
axlrules

8/22/2022 - Mon
William Domenz

An ASP.NET app is not really 'alive' until someone requests a page...
If you want to perform a specific job, you could use a web service to start the job, and have a scheduled Task in winodws call the web service...
Or just a Windows Service...

axlrules

ASKER
hey billy,
I have already created a webservice.
how do i create a scheduled tak in windows which calls the web service ?
thanks
William Domenz

You will have to create an app that calls the web service, and then set the scheduled task to call the app.
A little convaluted but should get you what u need...
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
axlrules

ASKER
Hey Billy,

Infact i already have a web app which is a client for the web service.
My problem is how to create the scheduled task.
can u give me some pointers on that or direct  me to somewhere where i can read up on it?
William Domenz

Sorry fo rthe confusion...
You can create a windows/console app that references your web service and have the Scheduled Task call that...  You can not have a Sheduled Task Call a web page or web service directly..
ASKER CERTIFIED SOLUTION
William Domenz

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
axlrules

ASKER
thanks billy
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.