System.Data.Entity.Infrastructure.DbUpdateException:SqlException: 不能更新时间戳列。
错误信息
System.Data.Entity.Infrastructure.DbUpdateException:“An error occurred while updating the entries. See the inner exception for details.”
System.Data.Entity.Infrastructure.DbUpdateException
HResult=0x80131501
Message=An error occurred while updating the entries. See the inner exception for details.
Source=EntityFramework
StackTrace:
at System.Data.Entity.Internal.InternalContext.SaveChanges()
此异常最初是在此调用堆栈中引发的:
[外部代码]
内部异常 1:
UpdateException: An error occurred while updating the entries. See the inner exception for details.
内部异常 2:
SqlException: 不能更新时间戳列。
解决方案
将Timestamp类型字段的属性添加[Timestamp]特性
C# 全选
[Timestamp]
public byte[] TS { get; set; }
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网