Using MS Visual Web Developer 2010 Express, I'm trying to create a simple site where I can view how many people are currently viewing the page. So far I've added a Web Form called 'home.aspx' this will be the only page and it will contain the gridview that displays how many people are viewing (using the sql COUNT function). There's also the default web.config file which I havn't modified yet.
I've added a sqlexpress database called 'Users' and created a Table called 'viewers'. 'viewers' has collumns IP (varchar(50)) and Time (datetime). The goal is for the table to grow (INSERT users) each time a viewer views the page, and get smaller (DELETE the user) when each person leaves.
I'm kinda stuck now:
1) I dont know what I have to put in my web.config file to create my connection string to my database (all the tutorials are written for people who know all the system.web mumbo jumo).
2) What do I write in my VB code behind file to INSERT users (I'm guessing I just need their IP and Time?) when they come to the site.
3) What do I write in my VB code behind to DELETE users if they leave. (I think this is the harder part. I dont know how to tell the database to constantly be checking to see if some IP address is still viewing, and then delete t
View Complete Post