473,388 Members | 1,277 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Timer in asp.net app.

Hello,
I need to write a routine that get executed every 2 hours independantly in
the backround on my asp.net web application.
How can this be done?
Many thanks in advance

JB
Nov 16 '05 #1
6 2215
Is this to process a database? Typically this stuff is not done in ASP.NET
but instead in a database procedure or another application running on the
server or client PC.

Chris

"Jensen Bredhal" <je************@yahoo.dk> wrote in message
news:eD**************@TK2MSFTNGP14.phx.gbl...
Hello,
I need to write a routine that get executed every 2 hours independantly
in the backround on my asp.net web application.
How can this be done?
Many thanks in advance

JB

Nov 16 '05 #2
write a windows service for this or a separate exe. you can write a web
application with a timer which is a global instance, but that requires the
application to always be running for the timer to go off.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://tinyurl.com/27cok
----------------------------------------------------------
"Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com> wrote
in message news:ub**************@TK2MSFTNGP10.phx.gbl...
Is this to process a database? Typically this stuff is not done in
ASP.NET but instead in a database procedure or another application running
on the server or client PC.

Chris

"Jensen Bredhal" <je************@yahoo.dk> wrote in message
news:eD**************@TK2MSFTNGP14.phx.gbl...
Hello,
I need to write a routine that get executed every 2 hours independantly
in the backround on my asp.net web application.
How can this be done?
Many thanks in advance

JB


Nov 16 '05 #3
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:eI**************@TK2MSFTNGP10.phx.gbl...
write a windows service for this or a separate exe. you can write a web
application with a timer which is a global instance, but that requires the
application to always be running for the timer to go off.


If your site is hosted with a public ISP, chances are they will not allow
you to deploy your own Windows services, create SQL Server jobs etc. If this
is the case, System.Threading.Timer instatiated in the Appliction_OnStart
event in Global.asax is pretty much your only option.
Nov 16 '05 #4
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

Read Tip 6 and get his example code, but basically you create a time in the
Global.aspx page in the application_start event. The example shows using an
HTTPModule, but my experimenting showed it worked just fine with the
application_start.

--
Thanks
Wayne Sepega
Jacksonville, Fl
"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:Ok**************@TK2MSFTNGP10.phx.gbl...
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:eI**************@TK2MSFTNGP10.phx.gbl...
write a windows service for this or a separate exe. you can write a web
application with a timer which is a global instance, but that requires the application to always be running for the timer to go off.
If your site is hosted with a public ISP, chances are they will not allow
you to deploy your own Windows services, create SQL Server jobs etc. If

this is the case, System.Threading.Timer instatiated in the Appliction_OnStart
event in Global.asax is pretty much your only option.

Nov 16 '05 #5
, create SQL Server jobs etc. If this
is the case, System.Threading.Timer instatiated in the Appliction_OnStart
event in Global.asax is pretty much your only option.


I was mostly thinking of something like this.
So far it is not possible to call web services inside MS sql server write?
So that is not an option.

So i guess either this solution or a windows service might
be my only choices. We own the hosting environnement so we can always
install just one more app.

Many thanks
JB
Nov 16 '05 #6
Great!

JB
"Wayne" <Me******@community.nospam> wrote in message
news:eD**************@TK2MSFTNGP10.phx.gbl...
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

Read Tip 6 and get his example code, but basically you create a time in
the
Global.aspx page in the application_start event. The example shows using
an
HTTPModule, but my experimenting showed it worked just fine with the
application_start.

--
Thanks
Wayne Sepega
Jacksonville, Fl
"When a man sits with a pretty girl for an hour, it seems like a minute.
But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:Ok**************@TK2MSFTNGP10.phx.gbl...
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:eI**************@TK2MSFTNGP10.phx.gbl...
> write a windows service for this or a separate exe. you can write a web
> application with a timer which is a global instance, but that requires the > application to always be running for the timer to go off.


If your site is hosted with a public ISP, chances are they will not allow
you to deploy your own Windows services, create SQL Server jobs etc. If

this
is the case, System.Threading.Timer instatiated in the Appliction_OnStart
event in Global.asax is pretty much your only option.


Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
6
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a...
9
by: HL | last post by:
I am using VS 2005 Beta - C# Problem: The Timer fires a few milliseconds before the actual Due-Time Let's say a timer is created in the following manner: System.Threading.Timer m_timer = null;...
7
by: Grahmmer | last post by:
I have a few timers that are added to a form at runtime. I can handle the event fine, but I cannot identify which timer fired. Is there a way to do this? Timer Creation: -------------...
2
by: John David Thornton | last post by:
I've got a Windows Service class, and I put a System.Threading.Timer, and I've coded it as shown below. However, when I install the service and then start it in MMC, I get a peculiar message: ...
12
by: Gina_Marano | last post by:
I have created an array of timers (1-n). At first I just created windows form timers but I read that system timers are better for background work. The timers will just be monitoring different...
8
by: KnighT | last post by:
I have a .net service that runs a System.Threading.Timer. The delegate points to the function that the service should execute when the timer elapses. Problem: The timer is not ticking. I have...
8
by: =?Utf-8?B?RGF2ZSBCb29rZXI=?= | last post by:
I have a Timer that I set to go off once a day, but it frequently fails! In order to debug I would like to be able to check, at any moment, whether the Timer is enabled and when it will next...
11
by: Hotrod2000 | last post by:
I'm quite new to programming but I'm having problems getting a timer to work in visual studio.net I've created a timer on a form, enabled it and then typed the following code (from the mdsn...
16
by: Peter Oliphant | last post by:
Note that although this involves SAPI, it is more a question about Timers and event handlers. I wrote a Speech Recognize handler (SAPI), and put some code in it to enable a Timer. It would not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.