473,399 Members | 4,254 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,399 software developers and data experts.

Is this normal methodology?

I do not consider myself a ASP expert by any means so I must ask this
question to see if this is normal or if there is a better way.

I have a web site that I have developed that uses a lot of DB lookups
for Comboboxes and sections, as well as other configs- All in a
database.

Instead of having this done on EVERY page via direct DB lookups.... We
are talking lots of SQL lookups for every page.

What I want to do is have an included page say SiteHeader.ASPX and do
the following

If Not Application("Initialized") then
InitializeMyApplication()
InitializeMyApplication() Will Do all the database Lookups and create
dropdowns dyanmicly and assign it to a string -- say S,

Application("SiteDropDownList5") = S
Application("Initialized") = True
Then just used this dynamically generated HTML on my pages.
Please Select: <%=Application("SiteDropDownList4")%>
Is this normal?

Dec 30 '05 #1
2 1142
What you propse would certainly work, but why not use the built-in caching
capabilities of ASP.Net?

I typically let my data handler manage the caching. When a method requests,
let's say dsAccountingCodes, for populating a dropdown list, the data handler
checks the cache for a value such as Cache["AccountingCodes"]. If
Cache["AccountingCodes"] is null then the data handler goes to the database,
retrieves the accounting codes list and returns the retrieved list after
storing it for the next request in cache using Cache.Insert.

I usually expire my cached objects in 15 to 30 minutes depending on the
application. You can use timed or other cache dependencies outlined on MSDN.

The next request for the same data will come from cache with no call to the
database.

Here's a place to start:

http://msdn.microsoft.com/library/de...nCacheAPIs.asp

--
Dale Preston
MCAD C#
MCSE, MCDBA
"Ta**********@gmail.com" wrote:
I do not consider myself a ASP expert by any means so I must ask this
question to see if this is normal or if there is a better way.

I have a web site that I have developed that uses a lot of DB lookups
for Comboboxes and sections, as well as other configs- All in a
database.

Instead of having this done on EVERY page via direct DB lookups.... We
are talking lots of SQL lookups for every page.

What I want to do is have an included page say SiteHeader.ASPX and do
the following

If Not Application("Initialized") then
InitializeMyApplication()
InitializeMyApplication() Will Do all the database Lookups and create
dropdowns dyanmicly and assign it to a string -- say S,

Application("SiteDropDownList5") = S
Application("Initialized") = True
Then just used this dynamically generated HTML on my pages.
Please Select: <%=Application("SiteDropDownList4")%>
Is this normal?

Dec 30 '05 #2
Ta**********@gmail.com wrote:
I do not consider myself a ASP expert by any means so I must ask this
question to see if this is normal or if there is a better way.

I have a web site that I have developed that uses a lot of DB lookups
for Comboboxes and sections, as well as other configs- All in a
database.

Instead of having this done on EVERY page via direct DB lookups.... We
are talking lots of SQL lookups for every page.

What I want to do is have an included page say SiteHeader.ASPX and do
the following

If Not Application("Initialized") then
InitializeMyApplication()
InitializeMyApplication() Will Do all the database Lookups and create
dropdowns dyanmicly and assign it to a string -- say S,

Application("SiteDropDownList5") = S
Application("Initialized") = True
Then just used this dynamically generated HTML on my pages.
Please Select: <%=Application("SiteDropDownList4")%>


I was about to suggest using the Cache, but Dale beat me to it. So, instead
i'll leave you with this boilerplate:

There was no way for you to know it, but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-knowledgeable person here who
can answer your question, you can eliminate the luck factor by posting your
question to a group where those dotnet-knowledgeable people hang out. I
suggest microsoft.public.dotnet.framework.aspnet.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Dec 30 '05 #3

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

Similar topics

5
by: Theodore Feldman | last post by:
Hi, Our DBA group is debating production release methodology. We always perfect our deployment package (typically a script) against the database in a Staging environment, before executing the...
8
by: PhilM | last post by:
I would like some assistance in methodology to reassign/reset array keys to consecutive numbering, while keeping in sync a second array that uses the key of the first as it's key set. If I have...
22
by: Ally | last post by:
Could someone give me an example of a modern development methodology? Just to see if I'm thinking along the right lines... P.S. Sorry for the cross posting but I couldn't find a newsgroup for...
0
by: Poch Reyes | last post by:
Hi Guys, Would anybody know a good application code review methodology? Your help is very much appreciated. Thanks a lot! Poch
2
by: Imran Aziz | last post by:
Hello All, I am fairly new to ASP.net. But have worked in various web based technologies for more then 5 years now, in CF and PHP e.g there is fusebox methodology to develop websites, and in ASP,...
0
by: Eric Sabine | last post by:
I want to show a datagrid to a user which contains about 100-200 records (6 columns). I would like to allow the user to alter certain columns while they're using the program. Then when they exit,...
1
by: Andy | last post by:
I'm looking to design a dating website, but don't really know where to start with the methodology for the database. I wonder if any of you know any links to sites that give good tutorials on this...
0
by: seaside | last post by:
Found today http://www.fusebox.org/ , wich claims to be a methodology and framework to develop web apps . Anybody here, who ever tried Fusebox? Might Fusebox be worth to take some days for...
3
by: robtyketto | last post by:
Im a student and in preparation for a testIve been given the test questions (or thereabouts, they may be asked in different words or from another perspective). I've been told that they do not...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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 project—planning, 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.