473,326 Members | 2,813 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.

ASP.NET Drop Down List Fill Method

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

Nov 19 '05 #1
1 2021
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" <cs********@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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

Nov 19 '05 #2

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

Similar topics

1
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the...
2
by: ramesh | last post by:
hi, I am using Com+ in my application. It will have InsertRecords,selectRecords,updateRecords function. In the Web Form i have Drop-down list. I want to select records from SQL and add it to this...
0
by: Giulio Santorini | last post by:
Hi, I've got two drop down list controls. When I select a value from the first one I fill the second one. And when I select a value from the second one I would like to fill another control. But...
13
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data...
3
by: Stephen Adam | last post by:
Hi there, I'm sure i'm missing something really simple here, all i want to do is get the value of the selected item in a list box. Even after much fiddling about last night I still could not get...
3
by: pmud | last post by:
Hi, I have 2 drop down lists on an asp.Net page. The 1st contains alphabets. When the user selects an alphabet frm the first list, the second drop down list should be populated with names from...
2
by: tom c | last post by:
I have a dropdown list box on an ASP.Net 1.1 webform. I populate it from a dataset in code. Everything looks fine and I can see all the values in the dropdownlist. I can select a value and I see...
2
by: bryan | last post by:
Hi all, I am developing a web app in .net 2.0. I have a few DropDownLists that are used on multiple web forms, these show shop locations and employees. Each DDL is placed inside a...
3
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the...
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: 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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.