467,905 Members | 1,875 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,905 developers. It's quick & easy.

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
  • viewed: 1137
Share:
2 Replies
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ganesh Kolappan via .NET 247 | last post: by
1 post views Thread by Marius | last post: by
2 posts views Thread by amessimon | last post: by
1 post views Thread by Urmal Patel via .NET 247 | last post: by
7 posts views Thread by Lastie | last post: by
1 post views Thread by Xuanly ly via .NET 247 | last post: by
2 posts views Thread by HH | last post: by
1 post views Thread by Miguel Dias Moura | last post: by
2 posts views Thread by John Smith | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.