TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
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
Forums
Monthly Leaders
Forum guidelines
Ankita Singh
NA
159
19.3k
update data in control through gridview
Mar 24 2018 1:08 AM
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
Reply
Answers (
9
)
Not support HTML format in Azure server through Sendgrid .
Dependency Injection ,Repository Pattern