实体框架插入错误(“版本字段是必需的。”)

发布于 2024-09-01 15:17:32 字数 309 浏览 3 评论 0原文

我正在使用 Silverlight 4 和 RIA 服务。当我尝试插入数据库时​​,出现以下错误:

“提交操作验证失败。请检查 EntitiesInError 中每个实体的 Entity.ValidationErrors 以获取更多信息。”

在检查 ValidationErrors 后,我看到:

“版本字段是必需的。”

Version字段不是由框架更新和维护的吗?如果是这样,为什么它是空的?如果没有的话我该如何设置呢?

I am using Silverlight 4 and RIA services. When I try to insert into my database, I get the following error:

"Submit operation failed validation. Please inspect Entity.ValidationErrors for each entity in EntitiesInError for more information."

Upon inspecting the ValidationErrors, I see:

"The Version field is required."

Isn't the Version field updated and maintained by the framework? If so, why is it null? If not, how am I supposed to set it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼中杀气 2024-09-08 15:17:32

这显然是 Silverlight 4 中的一个错误。希望它能在最终版本中得到修复。

只需设置 [Entity].Version = new byte[0]; 即可修复此问题。

This is apparently a bug with in Silverlight 4. Hopefully it will be fixed in the final release.

It can be fixed by simply setting [Entity].Version = new byte[0];.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文