开发者

ArgumentException in BindingManagerBase during EndCurrentEdit

I have a form that is has ma开发者_JS百科ny controls databound to a object with many properties and child objects.

When we call EndCurrentEdit on the BindMaster, it throws the following exception:

ArgumentException occurred: Object of type 'System.DBNull' cannot be converted to type 'System.String'.

Now I'm assuming that some property in the object is DBNull, however browsing through it I can not locate it. It could be in one of the many child objects as well.

Is there a simple way of determining -what- is DBNull so I can correct the underlying issue?

Or could this be caused by something else entirely?


Found out how to find the object causing the issue.

In Call Stack, right click and choose View External Code.

Select highest item in call stack, and view the Locals window.

this is the databinding, from there you can find out what item on your control has a value of null.

My case was a combo box which should have been a blank string, not a selected index of -1.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜