protected void GvDeleting(object sender, GridViewDeleteEventArgs e) { int id; if (int.TryParse(string.Format("{0}", e.Keys["p_Id"]), out id)) { Peoples = Peoples.Where(x => x.p_Id != id).ToList(); comm_sqlDataContext mylinq = new comm_sqlDataContext(); int bb = mylinq.deleterow(id); UpdateGrid(); } }
protected void goDelPeople(object sender, EventArgs e) { int id; People ff = Peoples[Convert.ToInt32(e_id.Value)]; if (int.TryParse(string.Format("{0}", ff.p_Id), out id)) { Peoples = Peoples.Where(x => x.p_Id != id).ToList(); comm_sqlDataContext mylinq = new comm_sqlDataContext(); int bb = mylinq.deleterow(id); UpdateGrid(); mylinq.Connection.Close(); } c_edit.Visible = false; c_ok.Visible = false; add.Visible = false; Table1.Visible = false; Table2.Visible = false; delete.Visible = false; }