views:

13

answers:

1

I have a form that is has many 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?

A: 

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.

Aequitarum Custos