hi,
in my application ,there is a dropdownlist.
after saving data to data base.
i want to add one field to dropdownlist
after the save command i wote
SqlCommand cmd = new SqlCommand("select cname from registration ", con);
con.Open();
SqlDataReader dr1 = cmd.ExecuteReader();
while (dr1.Read())
{
DropDownList1.Items.Clear();
DropDownList1.Items.Add(dr1.GetString(0));
}
dr1.Close();
but adding duplicates.
i have added "select a company" to drop downlist as first item;
how to avoid the duplicate value.
suppose if there are 10 records,if i add another record my
drop down list should contains
only 11 records with select a company at top.
Regards
K L BAIJU