Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=472540 for information on understanding and handling optimistic concurrency exceptions."
[HttpPost] [ValidateAntiForgeryToken] public async Task<ActionResult> Edit( StudentDetail studentDetail ) { if (ModelState.IsValid) { studentDetail .CashInHand -= studentDetail .CashReceived; studentDetail .Amount += studentDetail .CashReceived; studentDetail .Date = DateTime.Now; studentDetail .CashReceived= null; db.Entry(studentDetail ).State = EntityState.Modified; await db.SaveChangesAsync(); return RedirectToAction("Index"); } return View(studentDetail ); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)