job scheduling which work at time interval in web application in asp.net

Posted on March 24, 2009. Filed under: Asp.net | Tags: , , |

I am created that type of schedule which work properly. if that is helpfull for u then u appreciate it.

using System.Threading;

as namespace

following add in global.asax.cs

protected static Timer _timer;

protected void Application_Start(object sender, EventArgs e)
{
if (_timer == null)
{
var timerCallback = new TimerCallback(JobModulecls.jobshedule);//jobschedule is method which define in JobModulecls class as static method
var startTime = 0;
var interval = 60000; // 60 seconds
_timer = new Timer(timerCallback, null, startTime, interval);
}

}

protected void Application_End(object sender, EventArgs e)
{
_timer = null;
}

public sealed class JobModulecls
{
public static void jobshedule(object state)
{
//here u can write job shcheduling work such as
// coonect to database and work on table on time day schedule

}
}

Make a Comment

Make a Comment: ( None so far )

blockquote and a tags work here.

    About

    Hi,I am Suresh Sharma from Gorakhpur , UP, India.I have work on .net technology from 2 years. Key skills-Asp.net 2.0,3.5, Sql 2005,2000. Ajax.net 1.1,C#.net

    RSS

    Subscribe Via RSS

    • Subscribe with Bloglines
    • Add your feed to Newsburst from CNET News.com
    • Subscribe in Google Reader
    • Add to My Yahoo!
    • Subscribe in NewsGator Online
    • The latest comments to all posts in RSS
    • Subscribe in Rojo

    Meta

Liked it here?
Why not try sites on the blogroll...