Can asp.net do this?

  • Thread starter Thread starter Aaron
  • Start date Start date
A

Aaron

I want to write a script that deletes the last 10 records from a database on
the 1st of every month. Is there a way to do this without a user actaully
opens the page? Like windows schedule, it just starts on itself.

Note: This has to be a web-based app

Thanks
Aaron
 
You don't tell us what the DB is... IF it is SQL Server, then you can create
a Job within SQL Server and schedule it in SQL Server Agent. It has a pretty
good scheduler built right in. The Job can execute a a simple DELETE SQL
Statement a stored procedure containing more complex logic.

-J
 
Aaron said:
I want to write a script that deletes the last 10 records from a database on
the 1st of every month. Is there a way to do this without a user actaully
opens the page? Like windows schedule, it just starts on itself.

If you're needing this scheduling on your "shared hosting" server you do
depend on your provider to allow this.
There are some "patch solutions" as discussed in the past, such as: using an
item in the ASP.NET cache for a specific time. after that time an event will
be triggered. You can then check whether it's the first day of the month, or
you could using a timer in the global.aspx file etc... With all know
problems: if the server is rebooted etc...

Of course you could implement this functionality in an ASPX page and have
your local PC (in case of a remote shared hosting package) "visit" this page
on the first of each month.

My ASP.NET hosting provider (www.alentus.com) did setup some kind of cron
job for me (with no extra cost). It's a process that "visits" my page every
30 minutes. In this page you could check whether it's the first of the
month.

Wim
 
Annick Van Hoof said:
database

If you're needing this scheduling on your "shared hosting" server you do
depend on your provider to allow this.
There are some "patch solutions" as discussed in the past, such as: using an
item in the ASP.NET cache for a specific time. after that time an event will
be triggered. You can then check whether it's the first day of the month, or
you could using a timer in the global.aspx file etc... With all know
problems: if the server is rebooted etc...

Of course you could implement this functionality in an ASPX page and have
your local PC (in case of a remote shared hosting package) "visit" this page
on the first of each month.

My ASP.NET hosting provider (www.alentus.com) did setup some kind of cron
job for me (with no extra cost). It's a process that "visits" my page every
30 minutes. In this page you could check whether it's the first of the
month.

Wim

Also mine, www.DiscountASP.net does this. It's very helpful and a free
service.
 
Aaron:

You have a strange set of requirements. It _has_ to be a web-based
application, but at the same time, you want it to run on a scheduled
basis _without_ user interaction.

As many others have said, a web-based approach is sub-optimal, and you
shouldn't waste the ASP.NET engine's time with something like this.

Windows Service, SQL Server 2000 Job, any number of command line tools
to kick it off; all more suited for this type of application.

Good luck,
Sean
 
Back
Top