Calendar control and Null dates issue

  • Thread starter Thread starter Craig Buchanan
  • Start date Start date
C

Craig Buchanan

I have embedded an asp:Calendar control into the EditItemTemplate of
GridView column. I have set the SelectedDate='<%# Bind("Finished") %>'
VisibleDate='<%# Eval("Finished") %>', to the AccessDataSource's 'Finished'
column (a Date type).

The control correctly binds to the column if the date isn't null. If the
column is null, I get an error that reads:

Conversion from type 'DBNull' to type 'Date' is not valid.

What am I missing here? Is there an easy fix?

Thanks,

Craig Buchanan
 
Back
Top