473,397 Members | 2,099 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,397 software developers and data experts.

How to count the active ASP.NET Sessions (SQL Server)?

Hello,
I know that when the SessionState is set to SQL Server (ASP.NET 1.1) these
counters in PerfMon are not valued:
- Sessions Abandoned
- Sessions Active
- Sessions Timed Out
- Sessions Total
Is there another way to get these counters (especially "Sessions Active")
when the SessionState is set to SQL Server?
Thanks in advance!
Joe

--
Oct 9 '06 #1
2 3532
Joe,

Performance counters are only valid for In-Process session state management.
To count active sessions in SQLServer mode you need to create a stored
procedure in the tempdb database that returns the counter:

DECLARE @Now DATETIME

SELECT COUNT(*) AS SessionCount
FROM ASPStateTempSessions
WHERE (Expires < @Now)
hope this helps
--
Milosz Skalecki
MCP, MCAD
"JoeSep" wrote:
Hello,
I know that when the SessionState is set to SQL Server (ASP.NET 1.1) these
counters in PerfMon are not valued:
- Sessions Abandoned
- Sessions Active
- Sessions Timed Out
- Sessions Total
Is there another way to get these counters (especially "Sessions Active")
when the SessionState is set to SQL Server?
Thanks in advance!
Joe

--
Oct 9 '06 #2
Milosz,
Yes, thank you very much!

--
"Milosz Skalecki" wrote:
Joe,

Performance counters are only valid for In-Process session state management.
To count active sessions in SQLServer mode you need to create a stored
procedure in the tempdb database that returns the counter:

DECLARE @Now DATETIME

SELECT COUNT(*) AS SessionCount
FROM ASPStateTempSessions
WHERE (Expires < @Now)
hope this helps
--
Milosz Skalecki
MCP, MCAD
"JoeSep" wrote:
Hello,
I know that when the SessionState is set to SQL Server (ASP.NET 1.1) these
counters in PerfMon are not valued:
- Sessions Abandoned
- Sessions Active
- Sessions Timed Out
- Sessions Total
Is there another way to get these counters (especially "Sessions Active")
when the SessionState is set to SQL Server?
Thanks in advance!
Joe

--
Oct 9 '06 #3

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

Similar topics

2
by: Jay Chan | last post by:
We have just installed a SQL Server 2000 (SP 3A) onto a computer that has Windows-2003 Server on it. Now, we cannot get access to that database server from other computers. Seem like this may be an...
9
by: Terry E Dow | last post by:
Howdy, I am having trouble with the objectCategory=group member.Count attribute. I get one of three counts, a number between 1-999, no member (does not contain member property), or 0. Using...
4
by: Matthew Groch | last post by:
Hi all, I've got a server that handles a relatively high number of concurrent transactions (on the magnitude of 1000's per second). Client applications establish socket connections with the...
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
9
by: Laurent Bugnion | last post by:
Hi, I am wondering what is the best way to find out which ASP.NET sessions are still active. Here is the reason: I have a custom control which can upload files. It saves the files in a folder...
2
by: Krish........... | last post by:
Hi all, How to find out no of active sessions (at a time) in the web server.. I dont think handling Session_start and Session_end events are useful for this. Is there any way to find all current...
32
by: Ciaran | last post by:
Hi I've seen this a few places - The site lists off the number of people (not logged in) currently browsing the site. How can I do this with php / mySQL please?
6
by: bill | last post by:
I have been "Googling" for about an hour and am turning up squat! I just started receiving this error when trying to log into a MS Access database from a vb .net web application. Recycling IIS...
13
by: snowinfo | last post by:
Hi all, any way to count the number of users i have logged into my site? any help/code appreciated, craig
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

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.