I have multiple items in asp drop down list and I want to set its DataValueField to one by one using loop. I did it as follow.
int cnt = ddl2.Items.Count;
string val = ddl2.Items[j].ToString();
int datafieldid = // want datavaluefield id here