I dont know if it is a SqlException or not but I will show you the source code:
//the update method
public int Update(T item) { int result = 0; var query = BuildUpdateQuery(item); if (query != null) result = query.Execute(); return result; }
/////////////////////////////////////////////////////////////
public ActionResult Edit(Employee item) { if(ModelState.IsValid) { string resultMessage = "";
try
{ _repository.Update(item); resultMessage = item.DescriptorValue() + " updated!"; }
catch(Exception x)
{ //edit this to return a message resultMessage = "ERROR: "+ item.DescriptorValue() + " failed: "+x.Message; }
//if this is an Ajax request - just send back a message if (Request.IsAjaxRequest())
{ return Content(resultMessage); }
else { return RedirectToAction("Index"); } }
else { return View(); } }
/////////////////////////////////////////////////////////////////