Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: timing-automate reading from db


Message #1 by "rmitStudent" <s9810659@s...> on Wed, 7 Aug 2002 08:08:42
Hi All,

I would like to read a database every 10 minutes and display it in the 
browser without user's pressing the button thus automatically reads from 
database every 10 minutes. Is there a timing facility (in C# library) that 
I can use? I refresh my browser every 10 minutes by using meta refresh 
tag, however, i would like my backend (C#) code to also read every 10 
minutes and i do not have a clue at all. A simple sample code wold be 
really appreciated. Thank you for your help!!

Regards,
Cindy
Message #2 by Feduke Cntr Charles R <FedukeCR@m...> on Wed, 7 Aug 2002 09:47:12 -0400
	You really have two choices in this regard, and they both require
you write another program.  Basically you can write another program that
gets whatever data and objects you need from your database and posts that
information to your ASP.NET application (via a webform) as serialized
objects or sends the data some other way (places data as XML in a commonly
accessed directory for both the 2nd application or ASP.NET).  Then you can
either turn this program into an NT Service and write logic to cause it to
fire every 10 minutes, or you can add the program to Windows Scheduler (or
use the command line "at" command).

	You probably don't want to mess around with writing a timed loop in
your ASP.NET application unless you plan on getting busy with threads.  I
haven't tried to write anything to do a timed loop in ASP.NET, but I would
guess that you could initialize an instance of a class during the
Application_OnStart event and put it into a new thread; I would recommend
the above solution first though.

- Chuck

-----Original Message-----
From: rmitStudent [mailto:s9810659@s...]
Sent: Wednesday, August 07, 2002 4:09 AM
To: ASP+
Subject: [aspx] timing-automate reading from db


Hi All,

I would like to read a database every 10 minutes and display it in the 
browser without user's pressing the button thus automatically reads from 
database every 10 minutes. Is there a timing facility (in C# library) that 
I can use? I refresh my browser every 10 minutes by using meta refresh 
tag, however, i would like my backend (C#) code to also read every 10 
minutes and i do not have a clue at all. A simple sample code wold be 
really appreciated. Thank you for your help!!

Regards,
Cindy
Message #3 by "rmitStudent" <s9810659@s...> on Thu, 8 Aug 2002 23:42:14
Thanx Chuck, At least I know what my options are :>!!

cindy



> 	You really have two choices in this regard, and they both require
you write another program.  Basically you can write another program that
gets whatever data and objects you need from your database and posts that
information to your ASP.NET application (via a webform) as serialized
objects or sends the data some other way (places data as XML in a commonly
accessed directory for both the 2nd application or ASP.NET).  Then you can
either turn this program into an NT Service and write logic to cause it to
fire every 10 minutes, or you can add the program to Windows Scheduler (or
use the command line "at" command).

	You probably don't want to mess around with writing a timed loop in
your ASP.NET application unless you plan on getting busy with threads.  I
haven't tried to write anything to do a timed loop in ASP.NET, but I would
guess that you could initialize an instance of a class during the
Application_OnStart event and put it into a new thread; I would recommend
the above solution first though.

- Chuck

-----Original Message-----
From: rmitStudent [mailto:s9810659@s...]
Sent: Wednesday, August 07, 2002 4:09 AM
To: ASP+
Subject: [aspx] timing-automate reading from db


Hi All,

I would like to read a database every 10 minutes and display it in the 
browser without user's pressing the button thus automatically reads from 
database every 10 minutes. Is there a timing facility (in C# library) that 
I can use? I refresh my browser every 10 minutes by using meta refresh 
tag, however, i would like my backend (C#) code to also read every 10 
minutes and i do not have a clue at all. A simple sample code wold be 
really appreciated. Thank you for your help!!

Regards,
Cindy
Message #4 by "Wim Verdeyen" <Wim.Verdeyen@e...> on Mon, 12 Aug 2002 11:15:26 +0200
Hi,

You could use a .NET Windows Service to implement this kind of
functionallity.
You can create a such a service by creating a .NET Windows Service
project in Visual Studio .NET
Hope this helps....

Greetings 

Wim


-----Original Message-----
From: rmitStudent [mailto:s9810659@s...]
Sent: woensdag 7 augustus 2002 10:09
To: ASP+
Subject: [aspx] timing-automate reading from db


Hi All,

I would like to read a database every 10 minutes and display it in the 
browser without user's pressing the button thus automatically reads from

database every 10 minutes. Is there a timing facility (in C# library)
that 
I can use? I refresh my browser every 10 minutes by using meta refresh 
tag, however, i would like my backend (C#) code to also read every 10 
minutes and i do not have a clue at all. A simple sample code wold be 
really appreciated. Thank you for your help!!

Regards,
Cindy


  Return to Index