0
EntityModels을 처음 사용하고 데이터베이스에 새 레코드를 추가하는 데 문제가 있습니다. 'DbUpdateException'은 SaveChanges() 메서드에서 발생하며 "내부 예외"도 찾을 수 없습니다. 데이터베이스에 레코드를 추가 할 때 DbUpdateException이 발생합니다. C#
덕분에 (BookingId & DateEntered 데이터베이스의 기본값이) : 경우
//this is the code in the Bookings class
public void Save()
{
InsightEntities ie = new InsightEntities();
ie.Bookings.Add(this);
try
{
ie.SaveChanges(); //Error Occuring Here
}
catch (Exception err)
{
throw;
}
}
당신은 여기에 내가 추가하려고하고있는 기록이다 필요 advance
디버깅 중에 예외를 잡을 때,'.InnerException' 속성은 무엇을 말합니까? (힌트 : 메시지는 * 자세한 정보를 찾을 위치를 알려주는 곳입니다.) – David
Ahhhh는 유감스럽게도 innerMessage를 직접 보지 못해 죄송합니다. 그것이 깨졌을 때 datetime을 smalldatetime으로 변환하는 데 문제가있는 것으로 나타났습니다. – bolt19