Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
来源:互联网 发布:php一句话木马使用 编辑:程序博客网 时间:2024/06/05 23:04
try { // Your code... // Could also be before try if you know the exception occurs in SaveChanges context.SaveChanges(); } //在应用程序中,用下面的版本,调试,查看errMsg catch (DbEntityValidationException e) { string errMsg = string.Empty; foreach (var eve in e.EntityValidationErrors) { errMsg += string.Format("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); foreach (var ve in eve.ValidationErrors) { errMsg += string.Format("- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage); } } throw; } //在控制台,则直接输出 catch (DbEntityValidationException e) { foreach (var eve in e.EntityValidationErrors) { Console.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); foreach (var ve in eve.ValidationErrors) { Console.WriteLine("- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage); } } throw; }
- 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’解决方法
- entityframework-Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
- 如何知道错误: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' 错误
- Validation failed for one or more entities
- Validation failed for one or more entities
- 错误:One or more post-processing actions failed. Consult the OPP service log for details
- ORACLE EBS 问题 -One or more post-processing action failed. Consult the OPP service log for details.
- an error has occurred.See error log for more details
- an error has occurred.See error log for more details
- An error has occurred. See error log for more details.
- An error hasoccurred. See error log for more details.
- 云计算对移动扫描市场的影响
- 手机淘宝用户半年新增激活用户数突破1亿
- [深入浅出Cocoa]iOS网络编程之Socket
- ORA-19809: limit exceeded for recovery files问题解决
- LA3942 remember the word trie+dp
- Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
- 百度云开启防盗功能后无法卸载的原因
- 关于“网游屏蔽字简繁混合”的解决方案
- [深入浅出Cocoa]iOS网络编程之CFNetwork
- JAVA中static关键字详解
- Android SQLiteまとめ
- ubuntu 常见错误--Could not get lock /var/lib/dpkg/lock
- DDNS提供商记录
- 如何将datagridview中的数据导出到Excel中