do something every day...

  • Thread starter Bruno Alexandre
  • Start date
B

Bruno Alexandre

How can we manage in ASP.NET (using a hosted website - so there is nothing I
can do in the server) do perform a task every day at 11pm ?

in VB.NET we have the timer and if the application is running we can every 5
minutes see if the clock is right then execute the function, but how about
in ASP.NET, since we deveop for the same framework, shouldn't we had the
same thing?

I need to send the daily sales reports to email of the work list ... any
idea how to perform such task under ASP.NET and without "touch" the server
side?

Thank you.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

That's really not possible.

You could start a thread in global.asax, that would poll the time to
wait for the right moment, but that would require the application to
actually be started.

An ASP.NET application is only started if someone has made a request to
it, and the server might shut the appliction down if nonone has made a
request for a while. So there is no way that you can be sure that the
application is running at any given moment.
 
B

Bruno Alexandre

dam..!

with all this nice .NET framework 2.0, Microsoft could had thing in a way to
do thins under ASP.NET...

:-(
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

It's not the framework that sets the limitation. You are just trying to
do something that IIS is not intended for.
 
M

Mark Rae

with all this nice .NET framework 2.0, Microsoft could had thing in a way
to do thins under ASP.NET...

As Goran said, this is nothing to do with the Framework per se...

What I would do to get round this would be to create a webservice on the
site where I need the timer functionality, and then set up a call to this
webservice from my home network.

Luckily, I use www.hostinguk.net who offer full SQL Server integration with
remote management, so I never need to worry about this sort of thing...
 
B

Bruno Alexandre

I have SQL Server 2000 in my hosting package (I'm using www.brinkster.com)

without give me code examples (only if you want) what's the idea using
WebServices + ASP.NET + SQL Server to performe this task? can you inlight me
please...

the only thing tha occurs to my mind is having a table in sql with the DATE
AND TIME that the function performed and every entry of an user I check that
date, if the date is for the current day and the time is bigger than the
date in DB I performe the function and UPDATE the BD record to the next day.

but with this ideia I never get my stuff at the right time, I can get at 8pm
or 10.30pm, I'm depending on the users access to the website.

other thing is to have a small Window Forms running in a server company and
using the Timer in vb.net to perform the task every day in that hour, that
is for me, the simple thing... but I was undering if I could do it without
using window forms.
 
M

Mark Rae

I have SQL Server 2000 in my hosting package (I'm using www.brinkster.com)

without give me code examples (only if you want) what's the idea using
WebServices + ASP.NET + SQL Server to performe this task? can you inlight
me please...

1) Take the code which you would have liked to have put into a Timer, and
put it into a Webservice.

2) Create a WinForms app on your local network with a Timer which connects
to the Webservice as often as you want.
but with this ideia I never get my stuff at the right time, I can get at
8pm or 10.30pm, I'm depending on the users access to the website.

I'm afraid I don't understand what this means...
other thing is to have a small Window Forms running in a server company
and using the Timer in vb.net to perform the task every day in that hour,
that is for me, the simple thing... but I was undering if I could do it
without using window forms.

See above.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top