Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi DropDown Lists

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I have ten DropDown Lists linked to a field in a table.

cboProduct1.DataSource = DB.ExecuteReader
cboProduct1.DataTextField = "Componet"
cboProduct1.DataValueField = "Componet"
cboProduct1.DataBind()

dbcn.Close()

why wont .NET let me use the same DataSource with all the other drop down lists like in VB?

my dropdown lists are cboproduct1 - cboproduct10..

how can I bind all ten lists to the same datasource?

it will work for me if i create ten connections to the table..but I know thats not the way it should be done..

any help would be appreciated

thanks

 
Why not just call one function that executes the sql statement and place the results in a datatable or arraylist and bind the dropdown with the datatable or arraylist as the datasource?

hth,
drew10
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top