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.DataTextFiel d = "USER_NAME";
DropDownList4.DataValueFie ld = "USER_NAME";
DropDownList4.DataBind();
}
Where as the number 4 should be replaced by the i value. Is that possible?
Cheers
Chris
Something like this:
for (int i = 0; i < 3 ; i++)
{
DropDownList4.DataSource = cmd.ExecuteReader();
DropDownList4.DataTextFiel
DropDownList4.DataValueFie
DropDownList4.DataBind();
}
Where as the number 4 should be replaced by the i value. Is that possible?
Cheers
Chris
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I believe my answer was helpful.