I'm trying to get my JqGrid to update my database. I keep getting an Error: "Validation failed for one or more entities. See 'EntityValidationErrors' property for more details."
how do I find out what my actual error is or whats causing the error?
// TODO:insert a new row to the grid logic here
[HttpPost]
public string Create([Bind(Exclude = "Id")] AspNetUser obj)
{
//System.Diagnostics.Debug.WriteLine("Create");
string msg;
try
{
if (ModelState.IsValid)
{
db.AspNetUsers.Add(obj);
//db.AspNetUsers.Add(new AspNetUser { UserName = obj.UserName, Email = obj.Email });
db.SaveChanges();
msg = "Saved Successfully";
}
else
{
msg = "Validation data not successfull";
}
}
catch (Exception ex)
{
msg = "Error occured:" + ex.Message;
}
return msg;
}
ex
, try looking for it within the inner exception. – CodingYoshi