Calendar control and Null dates issue

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top