I have a FormView that I want to do something to avoid a data exception.
The control is bound to a SqlDataSource column and is giving me an exception
because it is null. I am using the DropDownCalendar control from Steve Orr
and I have the SelectedDate property bound to a datetime column. Is there
something I can do before data binding to keep from getting this error and
still have the control bound to the SqlDataSource? Thanks.
David
Phil H - 08 Dec 2007 21:49 GMT
> I have a FormView that I want to do something to avoid a data exception.
> The control is bound to a SqlDataSource column and is giving me an exception
[quoted text clipped - 3 lines]
> still have the control bound to the SqlDataSource? Thanks.
> David
Remove the databinding between the DropDownCalendar control and the
database column. Write some code in the DataBound event to assign the
selected date to the DropDownCalendar on the condition that it is not
null.