Hello,
I'm using VWD 2005 and have a grid on the page. In that grid, there's
a column that is of date/time type. Nulls are allowed in this column.
I'm having problems when trying to edit this date column.
I've converted the column to a template and changed the
EditItemTemplate from a textbox to a calendar. If a date previously
existed for the record being edited, the update action works. If the
date was previously NULL and then a date is chosen via the calendar
control, this error is thrown:
Server Error in '/Names' Application.
________________________________________
Conversion from type 'DBNull' to type 'Date' is not valid.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Conversion from type
'DBNull' to type 'Date' is not valid.
I've seen lot of solutions in my research where code fixes this. I'd
prefer to leverage the capabilities the development environment gives
me and solve it that way. Is there a property or a configuration I've
missed somewhere?
Thanks!