hello,
i am working in asp.net and oracle as database.
I have approximately 1000 agents in my users db, I want to know how many total agents are currently logged in portal. I want to show count of those agents like : Out of 1000 Agents 150 agents are logged in
I have log table which stores agent logged in time and logout time.
Anyway to get this output ?
Thanks in advance
Jignesh KumarPosted May 5, 2024, 6:25 AM
Hello Sushant,
You can achieve this using global.ascx file,
If you wish to display count on your webpage then you can display the active users count in a webpage:
Sushant TorankarPosted May 3, 2024, 3:32 PM
Thank you all for reply.
I was thinking about below code, but i think it will take more time to load as there are many users.
Any fast way to achieve, maybe from global.asax file or ApplicationSession?
Jayraj ChhayaPosted May 3, 2024, 5:54 AM
To determine the count of agents currently logged in, you can utilize SQL queries in Oracle. By querying the log table for active sessions (where logout time is null or within a specific range), you can calculate the number of agents logged in. Here's a sample query to achieve this:
This query counts the number of agents with no logout time recorded, indicating they are currently logged in. You can then display this count in your portal interface.
Jignesh KumarPosted May 3, 2024, 4:09 AM
Hello Sushant,
You can create one method using which you can get active use count,
As per my understanding once the user logs in you will make an entry in the table, so using below sql query you can find logs in user count,