My recouvrement is when will selected dropdown list that value is stored in my textbox
this is my code """"::::
code
protected void Button1_Click(object sender, EventArgs e)
{
try
{
string db = ConfigurationManager.ConnectionStrings["DDDB"].ConnectionString;
SqlConnection con = new SqlConnection(db);
SqlCommand cmd = new SqlCommand("select id, name,village from gridview ", con);
con.Open();
SqlDataReader rr = cmd.ExecuteReader();
DropDown1.DataTextField = "name";
DropDown1.DataValueField = "id";
DropDown1.DataSource = rr;
DropDown1.DataBind();
con.Close();
Lbl.Text = "connected";
TextBox1.Text = DropDown1.SelectedValue;
}
catch (Exception ex)
{
Lbl.Text = ex.Message;
// Response.Write("");
}
}


Ehsan SajjadRank #512 · 4.8K reputationPosted Jun 24, 2017, 3:01 PM EDT
Guruprakash C126 reputationPosted Jun 25, 2017, 5:33 AM EDT
Pradeep YadavRank #478 · 5.2K reputationPosted Jun 25, 2017, 7:37 AM EDT
Vivek KumarRank #272 · 9.3K reputationPosted Jun 25, 2017, 2:20 PM EDT
Santosh Reddy68 reputationPosted Jul 1, 2017, 10:44 PM EDT