PC Review


Reply
Thread Tools Rate Thread

ASP.NET Drop Down List Fill Method

 
 
csgraham74
Guest
Posts: n/a
 
      15th Aug 2005
Hi Guys,

I am currently building a web aplication in ASP.Net. On the onload
event of a page a have a function to populate the many drop down lists
on my page.

I have one parameter table which stores all the values e.g.
Title,Type,Status,Property,Occupation.

I am using a sql string and then populationg my drop down list
e.g.

strSQLQuery = "SELECT * FROM tbl_Parameters WHERE str_ParamType =
'Status'"

The problem that i am having is how best to populate each drop down
list efficiently as i am constantly opening and closing the connection
for each new sql String.

Can anyone point me in the best (or quickest and most efficinet) way to
populate multiple drop down list.

any thanks appreciated


CG

 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      15th Aug 2005
If they are lists of data that are used a lot and shared among users, you
could cache them in application state or the cache object in the form of a
DataTable.

Otherwise what you're doing is reasonably efficient. ADO.NET pools database
connections so you're not actually opening and closing as many connections
as you think you are.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"csgraham74" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Guys,
>
> I am currently building a web aplication in ASP.Net. On the onload
> event of a page a have a function to populate the many drop down lists
> on my page.
>
> I have one parameter table which stores all the values e.g.
> Title,Type,Status,Property,Occupation.
>
> I am using a sql string and then populationg my drop down list
> e.g.
>
> strSQLQuery = "SELECT * FROM tbl_Parameters WHERE str_ParamType =
> 'Status'"
>
> The problem that i am having is how best to populate each drop down
> list efficiently as i am constantly opening and closing the connection
> for each new sql String.
>
> Can anyone point me in the best (or quickest and most efficinet) way to
> populate multiple drop down list.
>
> any thanks appreciated
>
>
> CG
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill drop list Pastor Del Microsoft Access VBA Modules 8 8th Dec 2009 09:22 PM
Fill Drop Down with List Stockwell43 Microsoft Excel Misc 2 31st Jul 2008 09:01 PM
Drop Down List & Auto Fill =?Utf-8?B?c21yc3VuYm95?= Microsoft Excel New Users 2 3rd Sep 2007 05:56 AM
Auto Fill from Drop Down list Brian Microsoft Excel Worksheet Functions 3 2nd Nov 2006 09:56 PM
passing a list as a parameter to a TableAdapter Fill method Crazy Cat Microsoft VB .NET 3 8th Feb 2006 05:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:31 AM.