/// <summary> /// This function is used to delete a row from the database /// </summary> /// <param name="eid"> The id of the Employee who's data we wish to delete from the database</param> public void delete(Student modelobj) { var context = new TestDBEntities1(); context.Entry(modelobj).State = System.Data.Entity.EntityState.Deleted; context.SaveChanges(); }
/// <summary> /// This function is used to update a particular entry in the database /// </summary> public void update(Student studentobj) { var context = new TestDBEntities1(); context.Entry(studentobj).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); }
/// <summary> /// This function is used to update a particular entry in the database /// </summary> public void update(Employee modelobj) { var context = new TestDBEntities1(); context.Entry(modelobj).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); }
/// <summary> /// update method to update the records of the student datatable /// </summary> public void UpdateStudentVal(Student emp) { using (TestDBEntities1 context = new TestDBEntities1()) { context.Entry(emp).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } }