由于对象的当前状态,操作无效。 [英] Operation is not valid due to the current state of the object.

查看:127
本文介绍了由于对象的当前状态,操作无效。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

描述:

Description:

An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.





异常详细信息:



Exception Details:

System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException: Operation is not valid due to the current state of the object.





来源错误:



Source Error:

Line 871:				if (this._Login_Detail.HasLoadedOrAssignedValue)
Line 872:				{
Line 873:					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
Line 874:				}
Line 875:				this.Onlog_id_fkChanging(value);

推荐答案

没有错使用此代码!

HasLoadedOrAssignedValue 解析为true时,您要求抛出 ForeignKeyReferenceAlreadyHasValue 的例外...

这就是发生的事情......
There is nothing wrong with this code!
You asked to throw an exception of ForeignKeyReferenceAlreadyHasValue whenever HasLoadedOrAssignedValue resolves to true...
And that's what happening...


这篇关于由于对象的当前状态,操作无效。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆