hello guys... i was show data in textbox control and dropdown control click edit button in gridview after show data i want to update it.. i am showing my code
try
{
string qry = "update City_tbl set State=@State,City =@City where id=@id";
SqlConnection con = new SqlConnection();
SqlCommand cmd = new SqlCommand(qry, con);
cmd.Parameters.AddWithValue("@State", SqlDbType.NVarChar).Value = ddlstate.Text.Trim();
cmd.Parameters.AddWithValue("@City", SqlDbType.NVarChar).Value = TextBox1.Text.Trim();
con.Open();
cmd.ExecuteNonQuery();
con.Close();
FillGrid();
ClearControls();
lblMessage.Text = "Updated Successfully.";
}
catch
{
}
finally
{
if (con.State == ConnectionState.Open)
con.Close();
}
when i use breakpoint and debug then connectionis open but not close and not bind FillGrid() after this data is not updating... please some one tell me where is problem creating... thank you

Amit GuptaRank #190 · 12.8K reputationPosted Mar 23, 2018, 10:40 PM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Mar 23, 2018, 10:04 PM EDT
Ankita Singh176 reputationPosted Mar 23, 2018, 10:06 PM EDT
Ankita Singh176 reputationPosted Mar 23, 2018, 10:08 PM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Mar 23, 2018, 10:12 PM EDT
Ankita Singh176 reputationPosted Mar 23, 2018, 10:17 PM EDT
Ankita Singh176 reputationPosted Mar 23, 2018, 10:19 PM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Mar 23, 2018, 10:24 PM EDT
Ankita Singh176 reputationPosted Mar 23, 2018, 10:32 PM EDT