protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { int task_id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value);//this Line Gives Error using (DailyWorkReportDBEntities1 context = new DailyWorkReportDBEntities1()) { Task_Mst obj = context.Task_Mst.First(x => x.Task_Id == task_id); context.Task_Mst.DeleteObject(obj); context.SaveChanges(); FillTask(); ClientScript.RegisterStartupScript(this.GetType(), "alertMessage", "alert('Data Deleted');", true); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)