protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { Gio_Hang_KH ghkh2 = new Gio_Hang_KH(); AccessData ac = new AccessData(); if (e.CommandName == "del") { int tongtientt; int index = int.Parse(e.CommandArgument.ToString()); string sqltt = "select dongia from sach where masach = " + int.Parse(GridView1.Rows[index].Cells[0].Text); tongtientt = ac.ExecuteScalarInt(sqltt); Session["tongtien"] = (Int64.Parse(Session["tongtien"].ToString()) - tongtientt).ToString(); Session["xoagh"] = "deleted"; ghkh2.masach = int.Parse(GridView1.Rows[index].Cells[0].Text); ghkh2.deletesach(ghkh2); Response.Redirect("~/Gio_Hang.aspx"); } }