473,465 Members | 1,903 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Most Effective Way? Multiple asp:dropdownlist

Hi,

Quick question regarding dropdownlists.

On one page I have 10 asp:dropdownlists.
The user selects an option from a dropdown list and then it updates an
asp:label with the relevant text.
The user must select an option from each dropdown list.

All the dropdownlists are to be populated from a SQL database.
I am currently using the "OnSelectedIndexChanged" to call the function
after each change.
For datafilling the DropDownlists I was going to use ExecuteReader
command in the code. But by doing it this way, I need to open and
close a connection to the database for each datafill of the dropdown
list.
This doesnt seem very efficient to me, so I was wondering what the
experts view was on the most effective and efficient way of doing
this?

Any thoughts welcome and appriciated.

Thanks
H

p.s. - The data for the dropdownlists is all in one table, and I have
to run a seperate query to pull the relevant data out for each list.
p.p.s - I hope that all makes sense!!
Nov 18 '05 #1
2 1310
It is probably more effective to use a dataset.
Hit the DB once and pull back all the data that would satisfy every
dropdown.
Then use 10 dataviews on the dataset and bind each dropdown to a dataview.
--
Joe Fallon

"Harry" <ha************@hotmail.com> wrote in message
news:1c**************************@posting.google.c om...
Hi,

Quick question regarding dropdownlists.

On one page I have 10 asp:dropdownlists.
The user selects an option from a dropdown list and then it updates an
asp:label with the relevant text.
The user must select an option from each dropdown list.

All the dropdownlists are to be populated from a SQL database.
I am currently using the "OnSelectedIndexChanged" to call the function
after each change.
For datafilling the DropDownlists I was going to use ExecuteReader
command in the code. But by doing it this way, I need to open and
close a connection to the database for each datafill of the dropdown
list.
This doesnt seem very efficient to me, so I was wondering what the
experts view was on the most effective and efficient way of doing
this?

Any thoughts welcome and appriciated.

Thanks
H

p.s. - The data for the dropdownlists is all in one table, and I have
to run a seperate query to pull the relevant data out for each list.
p.p.s - I hope that all makes sense!!

Nov 18 '05 #2
Hi,

Thanks for the info.
I don't suppose by any chance you could point me in the direction of
some samples. (sample code c#)
I have had a look, but cant seem to find anything relevant.

Any help appriciated as always.
H


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

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

Similar topics

0
by: Ganesh Kolappan via .NET 247 | last post by:
Hi I am trying to populate a <asp:dropdownlist> in a XSLT file withdatasource pointing to a C# codebehind file method which returnsa dataview. I am using XSLT extension object. But I am...
1
by: Marius | last post by:
Hi all, I need an asp:dropdownlist on a webform that is databound to a dataset. This works fine and returns the data to populate my dropdownlist. In the DB I only have valid data, but I need a...
1
by: Harry | last post by:
Hi, Just seeing if anyone can help me with a problem I am having with drop down lists. - I have a asp:dropdownlist that gets its values from a database. - The user then selects a value then...
2
by: amessimon | last post by:
I need to display a drop down list which holds up to 250 listitems. I'd like to create this programmatically rather than have to hardcode it into the page. For example <asp:DropDownList...
1
by: Urmal Patel via .NET 247 | last post by:
I have problem with asp:Dropdownlist. I have a dropdownlist control in Page1.aspx and I want to assign value and Text to dropdown list form Page2.aspx from java script function. I am able to assign...
7
by: Lastie | last post by:
Hi all, I’ve got a ‘dropdownlist’ web control and I can add ‘listitem’ no problem. I can also bind data from an SQL database fine. My problem is that I want to do both at the same...
1
by: Xuanly ly via .NET 247 | last post by:
asp:dropdownlist always display infront of everything and I can't make it display behind HELP HELP help!!!. <form id="Form1" method="post" runat="server"> <asp:TextBox id="TextBox1"...
2
by: HH | last post by:
Hi, I have a dropdown list that is datafilled via a SQL table. The text part is always unique. (A list of countries) Each country is assigned one of three numbers. (This being the 'value' of...
1
by: Miguel Dias Moura | last post by:
Hello, I have two questions concerning Asp:DropDownList 1. How to fill a DropDownList from runtime and set its default item? 2. How do use a DropDownList in each datagrid record? All...
2
by: John Smith | last post by:
I have this DataGrid: <asp:datagrid id="dg1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn HeaderText="SM"> <ItemTemplate> <asp:Label id="Label2" runat="server"...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.