[RESOLVED] Data Bindings - Invalid cast exception with DBNulls
Hello,
I'm binding a ComboBox's SelectedIndex to a Nullable database field like so:
VB.NET Code:
ColapsoComboBox.DataBindings.Add("SelectedIndex", EnsaiosBindingSource, "Colapso", False, DataSourceUpdateMode.OnValidation, 0)
As you can see, I've defined the NullValue to be zero, yet I get an InvalidCastException.
Is there anything I'm doing wrong? Or is handling the binding's Format and Parse events the only way around this?
Thanks in advance
Re: Data Bindings - Invalid cast exception with DBNulls
Re: Data Bindings - Invalid cast exception with DBNulls
I've fixed it by setting formattingEnabled to True.