field name,text field name,the dataset and the
method will automatically fill the drop down list.
the method is -
public void PopulateList(DropDownList list,
string valueField, string textField, DataSet dataset)
{
if( dataset == null || dataset.Tables.Count == 0 ||
list == null ) return;
//Enable to add empty item to list
for (int irow = 0; irow < dataset.Tables[0].Rows.Count; irow++)
{
list.Items.Add(new ListItem(Convert.ToString
(dataset.Tables[0].Rows[irow][textField]),
Convert.ToString(dataset.Tables[0].Rows[irow][valueField])));
}}