according to your code..the values does not populate to the dropdownlist.
dropdownlist2.DataTextField = "Code";
dropdownlist2.DataValueField = "Code";
because, it will not hold the values but it just assigns the values to the
dropdownlist textfield and value field.
to populate.this is one of the method
prepare the dataset;
dataset dv;
int n = dv.Tables["tblcountry"].Rows.Count;
DropDownList.Items.Clear();
DropDownList.Items.Add("--Select--");
for (int i = 0; i <= n - 1; i++)
{
DropDownList.DataSource = dv;
ListItem li = new ListItem();
li.Text = dv.Tables["tblcountry"].Rows[i][1].ToString();
li.Value = dv.Tables["tblcountry"].Rows[i][0].ToString();
DropDownList.Items.Add(li);
}
it works try this method.