i bind country name and code with dropdown like this:
SqlConnection con = new SqlConnection(str);
con.Open();
SqlCommand cmd = new SqlCommand("select countryname,countrycode from country", con);
SqlDataReader dr = cmd.ExecuteReader();
ddlcountry.DataSource = dr;
ddlcountry.Items.Clear();
ddlcountry.Items.Add("--Please Select country--");
ddlcountry.DataTextField = "countryname";
ddlcountry.DataValueField = "countrycode";
ddlcountry.DataBind();
con.Close();
and now when i insert country name in db like :
SqlParameter country = new SqlParameter("country", ddlcountry.SelectedItem.Text);
it insert "--Please Select country--" in db,,
what will be the solution for this?
thanks in advance
...
Go to the complete details ...