I have the following Action method inside my Asp.net mvc web application:-
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create(SDJoin sdj, FormC
Although this is an old post but this approach can be more fruitful!
Credits
Try something like this
try
{
pcontext.SaveChanges();
}
catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException ex)
{
Console.WriteLine(ex.InnerException);
}
catch (System.Data.Entity.Core.EntityCommandCompilationException ex)
{
Console.WriteLine(ex.InnerException);
}
catch (System.Data.Entity.Core.UpdateException ex)
{
Console.WriteLine(ex.InnerException);
}
catch (System.Data.Entity.Infrastructure.DbUpdateException ex) //DbContext
{
Console.WriteLine(ex.InnerException);
}
catch (Exception ex)
{
Console.WriteLine(ex.InnerException);
throw;
}