Want to build the ChatGPT based Apps? Start here
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Santosh Reddy
2.1k
64
17.6k
dropdownlist some code problems will come
Jun 24 2017 2:01 PM
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("<script>alert('" + ex + "')</script>");
}
}
Reply
Answers (
5
)
How can i find memory leaks in Asp.net website.
How do i integrate and work with hangouts in my asp.net site