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

What would you do...Application Obj or constant SQL drills

I developed and manage an intranet for a small, govt agency. The way it is
set up now is that there is a Function on each and every page that will
capture the NT Log On User ID (b/c they had to log into the Windows network
to even access the intranet) and query against a SQL Server table called
"Staff". Assuming the user is in the table (they should be), it will let
them access the page as normal and it sets a series of session variables
that are used throughout the application such as a "permission score", Full
Name, Active, StaffID, Department and other useful stuff that use throughout
the intranet.

The upside to this is that the user never has to "log in" to the
intranet...they just open up IE. The downside is that it might not be all
that efficient.....pulling and creating a recordset and (re)setting session
variables on each and every page. I've never had any bottlenecking or
strain on the server or IIS but then again, it's a small agency...less than
50 people.

Since I'm overhauling it and moving towards .NET, I've been thinking of a
more efficient way of doing this. I thought about using a global.asax file
and upon the start of the application, pull and create this "Staff"
recordset and store it into an array in an Application Object. That way,
with the request of each and every page, I can just check against that array
to see if they have permission and to see other data I need about the user.
The only downside to this is that the array's recordset would be static and
changes made in the Staff Table wouldn't be shown in the array until the
application is stopped and restarted.

So...to the gurus out there....what would you do? Make the array? Pull
Staff data from SQL Server on each page? Or other?

TIA

--
*********************************
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*********************************

Nov 17 '05 #1
2 1030
I think you're barking up the right tree here, but maybe the wrong branch.
You say that every page has this code that checks the user's login against a
database table, and sets up a bunch of Session variables afterwards. What I
would do is just use the Session_OnStart Sub to do this one time at the
beginning of the Session. After this, the Session variables are loaded, and
the User is validated. No need to requery the database with the same login
information afterwards.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"D. Shane Fowlkes" <sh***@raccoonbob.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I developed and manage an intranet for a small, govt agency. The way it is set up now is that there is a Function on each and every page that will
capture the NT Log On User ID (b/c they had to log into the Windows network to even access the intranet) and query against a SQL Server table called
"Staff". Assuming the user is in the table (they should be), it will let
them access the page as normal and it sets a series of session variables
that are used throughout the application such as a "permission score", Full Name, Active, StaffID, Department and other useful stuff that use throughout the intranet.

The upside to this is that the user never has to "log in" to the
intranet...they just open up IE. The downside is that it might not be all
that efficient.....pulling and creating a recordset and (re)setting session variables on each and every page. I've never had any bottlenecking or
strain on the server or IIS but then again, it's a small agency...less than 50 people.

Since I'm overhauling it and moving towards .NET, I've been thinking of a
more efficient way of doing this. I thought about using a global.asax file and upon the start of the application, pull and create this "Staff"
recordset and store it into an array in an Application Object. That way,
with the request of each and every page, I can just check against that array to see if they have permission and to see other data I need about the user. The only downside to this is that the array's recordset would be static and changes made in the Staff Table wouldn't be shown in the array until the
application is stopped and restarted.

So...to the gurus out there....what would you do? Make the array? Pull
Staff data from SQL Server on each page? Or other?

TIA

--
*********************************
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*********************************

Nov 17 '05 #2
Thanks Kevin...that's brilliantly simple.

D'oh!

--
*********************************
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*********************************
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:ed**************@TK2MSFTNGP09.phx.gbl...
I think you're barking up the right tree here, but maybe the wrong branch.
You say that every page has this code that checks the user's login against a database table, and sets up a bunch of Session variables afterwards. What I would do is just use the Session_OnStart Sub to do this one time at the
beginning of the Session. After this, the Session variables are loaded, and the User is validated. No need to requery the database with the same login
information afterwards.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"D. Shane Fowlkes" <sh***@raccoonbob.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I developed and manage an intranet for a small, govt agency. The way it

is
set up now is that there is a Function on each and every page that will
capture the NT Log On User ID (b/c they had to log into the Windows

network
to even access the intranet) and query against a SQL Server table called
"Staff". Assuming the user is in the table (they should be), it will let them access the page as normal and it sets a series of session variables
that are used throughout the application such as a "permission score",

Full
Name, Active, StaffID, Department and other useful stuff that use

throughout
the intranet.

The upside to this is that the user never has to "log in" to the
intranet...they just open up IE. The downside is that it might not be all that efficient.....pulling and creating a recordset and (re)setting

session
variables on each and every page. I've never had any bottlenecking or
strain on the server or IIS but then again, it's a small agency...less

than
50 people.

Since I'm overhauling it and moving towards .NET, I've been thinking of a more efficient way of doing this. I thought about using a global.asax

file
and upon the start of the application, pull and create this "Staff"
recordset and store it into an array in an Application Object. That way, with the request of each and every page, I can just check against that

array
to see if they have permission and to see other data I need about the

user.
The only downside to this is that the array's recordset would be static

and
changes made in the Staff Table wouldn't be shown in the array until the
application is stopped and restarted.

So...to the gurus out there....what would you do? Make the array? Pull
Staff data from SQL Server on each page? Or other?

TIA

--
*********************************
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*********************************


Nov 18 '05 #3

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

Similar topics

2
by: CoolPint | last post by:
Can anyone clearly explain the difference between constant reference to pointers and reference to constant pointers? What is const int * & ? Is it a constant reference to a pointer to an...
8
by: DKode | last post by:
OK, so i'm designing a very large business auction website for a customer. It would include such features as: Auctions, search, registration, payment, fees on auctions, consignment services...
8
by: DKode | last post by:
OK, so i'm designing a very large business auction website for a customer. It would include such features as: Auctions, search, registration, payment, fees on auctions, consignment services...
32
by: Stephen Horne | last post by:
I've been using Visual C++ 2003 for some time, and recently started working on making my code compile in GCC and MinGW. I hit on lots of unexpected problems which boil down to the same template...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.