Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
- {
- int index = Convert.ToInt32(e.CommandArgument);
- string sqlQuery = "Update mytable set ID = @ID WHERE No ="+ index;
- GridOpen(sqlQuery);
- }
- void GridOpen(string send)
- {
- string con = "conn string";
- using (SqlConnection dataConnection = new SqlConnection(con))
- {
- using (SqlCommand dataCommand = new SqlCommand(send, dataConnection))
- {
- int ld = 121;
- dataCommand.Parameters.AddWithValue("ID", ld);
- dataConnection.Open();
- dataCommand.ExecuteNonQuery();
- dataConnection.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement