public void UpdateStudent(int id, string name, int number, DateTime date, string status) { var db = new QLBHEntities(); var Good = db.Goods.Find(id); Good.name = name; Good.number = number; Good.date_add = date; Good.status = status; db.Entry(Good).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); }