Add to Favorites    Make Home Page 2298 Online  
 Language Categories  
 Our Services  

Home » ASP Home » Performance Home » Worlds Fastest Listbox w/Application Data

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Worlds Fastest Listbox w/Application Data
Description Sometimes data (like a HTML list box) is displayed on many pages of a website. In fact, the database generated list box is displayed thousands of times a day, and the database is queried every time, but it is unnecessary. The database it is drawn from is not changing thousands of times a day. In the following example any page that displays the list boxes needs to only access the application variables, not hit the database. Very speedy. If the data changes or gains new records, a trigger mechanism could be added to sense data changes and only rebuild the list box if records were added or changed. These scripts is a "proof of concept" script that displays the listboxes without re-querying the database. If you like this approach, this is merely a "proof of concept" and "teaching example". A much more thorough implementation of caching and high speed data retrieval is at: http://www.learnasp.com/learn/rsfast.asp which is a very fast database retrieval library I made and add features and speed tweaks too constantly that supports caching mechanisms too. ListMakedemo.asp is the main script. Simple enough.
Category ASP » Performance
Hits 382019
Code Select and Copy the Code
<HTML> <TITLE>listmakedemo.asp</TITLE> <body bgcolor="#FFFFFF"> <br> City: <!--#include virtual="/learn/test/listcity.asp"--> <br> State: <!--#include virtual="/learn/test/liststate.asp"--> <br> Zip: <!--#include virtual="/learn/test/listzip.asp"--> </BODY></html> ListCity.asp displays listbox of cities. <!--#include virtual="/learn/test/lib_listmake.asp"--> <% If application("list_city")="" Then myDSN="DSN=student;uid=student;pwd=magic" mySQL="select distinct city from publishers" application("list_city")=query2htmlist(mySQL,"cities",myDSN) End If Response.Write application("list_city") %> ListState.asp displays listbox of states <!--#include virtual="/learn/test/lib_listmake.asp"--> <% If application("list_states")="" Then myDSN="DSN=student;uid=student;pwd=magic" mySQL="select distinct state from publishers" application("list_states")=query2htmlist(mySQL,"state",myDSN) End If Response.Write application("list_states") %> ListZip.asp displays listbox ofzips. <!--#include virtual="/learn/test/lib_listmake.asp"--> <% If application("list_zips")="" Then myDSN="DSN=student;uid=student;pwd=magic" mySQL="select distinct zip from publishers" application("list_zips")=query2htmlist(mySQL,"zip",myDSN) End If Response.Write application("list_zips") %> Lib_Listmake.asp Is a library that makes it easier To make listboxes. <% Function query2htmList(myquery,myname,myDSN) Dim conntemp, rstemp Set conntemp=Server.CreateObject("adodb.connection") conntemp.open myDSN Set rstemp=conntemp.execute(myquery) query2HTMlist="<Select name='" & myname & "'>" Do until rstemp.eof thisfield=Trim(RStemp(0)) If IsNull(thisfield) Or thisfield="" Then ' ignore Else query2HTMlist=query2HTMlist & "<option>" & thisfield & "</option>" End If rstemp.movenext Loop query2HTMlist=query2HTMlist & "</select>" rstemp.close Set rstemp=Nothing conntemp.close Set conntemp=Nothing End Function %> ListMakeClear.asp Is a crude mechanism To force all the listboxes To refresh. It could be invoked On a timed basis (every 15 minutes For example) Or triggered by data-changes. <% application("list_city")="" application("list_states")="" application("list_zips")="" %>

Related Source Codes

Script Name Author
��������������������� VyomWorld
Resistor color code reader A.Chermarajan.
Telephone Directory dhivya
card swapping game (Mini Project) nityanand
simple hangman-pascalsource Seabert
college dirtectory (Mini Project) msridhar
Poll Application John van Meter
ASP Daily Hit Counter. Tejaskumar Gandhi
To avoid null in asp environment using sql Sami
Maklumbalas webmaster
poll John van Meter
EasyASP Template Engine. TjoekBezoer
Basic Calculator using HTML & Javascript. Patrick M. D Souza
What servers support ASP ? VyomWorld
What is ASP? VyomWorld

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=261


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review