Null and bound textbox

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
 
J

J.P. HAMILTON

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top