Set datetime property to null when deleting date
Posted on 2009-03-30
How do you enable deletion of a date value in a textbox bound to a strongly typed datarow of column type system.datetime? The textbox is bound to a binding source which has its datasource set to the datarow.
When I delete the date from the textbox and click on save on my form I update the dataset which seems to work fine, however when I come back to that record the old date is still there.
I assume this is because an empty string cannot be converted to a date so the stringly typed datarow cannot be updated.
I know this should be simple as it is a pretty standard operation but I have not been able to find a simple solution for this.
Can anyone help?