FormView Null databound value

  • Thread starter Thread starter David C
  • Start date Start date
D

David C

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
 
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

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.
 
Back
Top