Brother you don't have to do like that.
you have Global.asax file in your web project.
void Application_Start(object sender, EventArgs e)
{
Application["Visitors"] = 0;
}
void Application_End(object sender, EventArgs e)
{
}
void Application_Error(object sender, EventArgs e)
{
}
void Session_Start(object sender, EventArgs e)
{
Application.Lock();
Application["Visitors"] = Convert.ToInt32(Application["Visitors"])+1;
Application.UnLock();
}
void Session_End(object sender, EventArgs e)
{}
Whenever session_start event occurs you need to increase your visitor value by one & you can insert that value in the database.
Hope it helps