Null and bound textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a texbox on a form bound to a column in a dataset's datatable.
Some of the records in the database have a null value for this column.
However, the textbox's text property cannot handle that.

If I were using an unbound form and a datatreader to populate the form, I
could simple check for nulls. Surely there must be a way to indicate how
databindings should handle a null instead of just throwing an error.

Any help is appreciated.

WR
 
There is a longer form of TextBox.DataBinding.Add that will let you specify
what to display in the event of a null. We use this everywhere for the exact
same reason.
 
Back
Top