Data binding and DBNULL

  • Thread starter Thread starter Adam Klobukowski
  • Start date Start date
A

Adam Klobukowski

Hello

I have an untyped DataSet that I'm binding data into my form controls.
Binding works well (ie. no this.controll.DataBindings.Add throws an
exception) but when form is shown and some fields of a current row of
the dataset are DBNNULLs I have an exception that I cannot cast DBNULL
to other types...

What can I do to avoid this exception?
 
Hello Adam,

What if you attach custom handlers to the DataBindings' Format and Parse
events and provide proper DBNull handling in these events?
I even think handling Format only will be enough if you don't need to
convert some pre-defined values typed by the user to DBNull.
 
Back
Top