Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
来源:互联网 发布:mac刻录win7安装光盘 编辑:程序博客网 时间:2024/05/29 17:17
Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
Validation failed for one or more entities. See ‘EntityValidationErrors’ property for moredetails. Unfortunately there is no further information about
关于如何查看 EntityValidationErrors 详细信息的解决方法
我们在 EF 的编程中,有时候会遇到这样一个错误:
但是,按照他的提示 “See ‘EntityValidationErrors’ property for more details.” 去 Exception 中查看,却只能看到
并不能看到具体的是那个属性为什么验证不通过,也许不少人都遇到这种情况。
这里给大家介绍一个Exception类,让我们能够轻松的知道具体的哪一个字段出了什么问题。
那就是 System.Data.Entity.Validation.DbEntityValidationException,相信代码都知道怎么写了,最简单的就是
try
{
// 写数据库
}
catch (DbEntityValidationException dbEx)
{
}
在 dbEx 里面中我们就可以看到
这样子我们就能看到 EntityValidationErrors 所有的 ValidationErrors 的详细信息了。
0 0
- Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
- Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
- entityframework-Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
- EF--Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
- Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
- Validation failed for one or more entities. See 'EntityValidationErrors' property for more details
- Validation failed for one or more entities. See 'EntityValidationErrors' property for more details
- Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
- 如何知道错误:Validation failed for one or more entities. See 'EntityValidationErrors' 的原因
- 如何处理 Validation failed for one or more entities. See 'EntityValidationErrors' 错误
- Validation failed for one or more entities
- Validation failed for one or more entities
- Failed to instantiate one or more classes
- one or more listeners failed to start
- 错误:One or more post-processing actions failed. Consult the OPP service log for details
- one or more files from the emulator for windows ce installation is missing 解决方法
- (转)one or more files from the emulator for windows ce installation is missing 解决方法
- arcgis的One or more layers failed to draw: 问题
- 键盘虚拟键值表
- PCF8591读写
- C# 常用加密方法收集 对称,非对称
- JD-GUI反编译后代码逻辑分析
- 设计模式: 命令(command)模式
- Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
- 跨越速运定制化服务:快递晚上也能送
- 坐标移动
- solr查询参数、语法、函数总结
- 世界电影史--笔记
- 欢迎使用CSDN-markdown编辑器
- 在PHP模板引擎smarty生成随机数的方法和math函数详解
- IOS——使用PresentViewController推送页面,各页面间跳转及遇到的问题
- 细说跨越速运的限时服务