failure of ComboBox to bind to DBNull

PhilEngle

New member
Joined
Dec 3, 2004
Messages
3
Programming Experience
10+
This error occurs with respect to all of the cases where a combobox represents an optional, nullable column that is constrained by a foreign key and an attempt is made to save a new record and the user has made no manual selection using the combobox.

The error has been narrowed down to the failure of the combobox control to automatically bind to the assigned, initial System.DBNull.Value when the new record is initially automatically filled in by the system. (Instead the combobox erroneously binds to zero.) However, if the user selects the blank item in the combobox (associated with System.DBNull.Value), then the System.DBNull.Value does successfully bind to the control.

As a result of this binding failure, an attempt to save the record throws a foreign-key constraint failure, and the record will not save.

Any help anyone could give would be much appreciated!

 
Top Bottom