Link to home
Start Free TrialLog in
Avatar of ccoe1
ccoe1

asked on

for loop for dropdownlist

Hi, I would like to have a for loop which fills the same values from a database into 3 dropdownlists
Something like this:

for (int i = 0; i < 3 ; i++)
{
DropDownList4.DataSource = cmd.ExecuteReader();
DropDownList4.DataTextField = "USER_NAME";
DropDownList4.DataValueField = "USER_NAME";
DropDownList4.DataBind();
}

Where as the number 4 should be replaced by the i value. Is that possible?

Cheers

Chris
ASKER CERTIFIED SOLUTION
Avatar of TDSnet
TDSnet

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TDSnet
TDSnet

I believe my answer was helpful.