this is my error when I'm inserting a record to database using MVC 4 and entity framework.
this is my codes:
[HttpPost]
public ActionResult AddUser(Users u)
{
SystemUser su = new SystemUser()
{
Username = u.Username,
Password = u.Password,
FirstName = u.FirstName,
LastName = u.LastName,
MiddleName = u.MiddleName,
TerminalAccess = Convert.ToByte(u.TerminalAccess),
MPassAccess = u.MPassAccess,
CreationDate = u.DateCreation,
ApplicationName = u.ApplicationName,
Email = u.Email,
IsApproved = u.isApproved
};
db.SystemUsers.Add(su);
db.SaveChanges();
return View();
}
is there problem with my code or just the entity itself have a problem? please help. thanks in advance