Search Search

#1 worldwide
FREE Coding Lessons

since 1996
   THE BEST WAY to learn ASP & Asp.net!
Advertise Here!
click for details
Credits Host:
DiscountASP.net
Server Admin:
The "Team"
Contact Info.
Charles M. Carroll

my Blog

ASP Commandment #8: Property Reads are Expensive

Do not fetch any values obtained via ASP/COM more than once. Store them and use the stored values. It speeds up code significantly. Typical examples people forget this include recordset values, request.form and request.querystring.

This is bad (3 COM calls where 1 would accomplish same task):
<%
if rstemp("city")="Dallas" then
   ' do something

end if
if rstemp("city")="New York" then
   ' do something

end if
if rstemp("city")="New Orleans" then
   ' do something

end if
%>

This is good:
<%
thecity=rstemp("city")
if thecity="Dallas" then
   ' do something

end if
if thecity="New York" then
   ' do something

end if
if thecity="New Orleans" then
   ' do something

end if
%>

Chaz Wish List
Tall Tip $5
Grande Tip $20
Venti Tip $39
Tip Jar Thanks
2004 Thanks
2005 Thanks
HUGE Tip -love site