2.0 Calendar Control - SelectedDate = NULL???

K

K B

Hi,

I have a calendar control inside an EditItemTemplate. All works great
except when the date field in the db is Null. I get the 'cannot cast
string to datetime type' error.

I haven't figured out which event on the DetailsView control, if any,
will allow me to check for Null, then perhaps do a calendar.clear.

Again, any help much appreciated.

Kit
 
S

S. Justin Gengo

Kit,

You should either set the date programatically first checking for Is NULL
(c#) Is Nothing (vb) and selecting a default date if so. Or disallow null
values in your database.

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

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,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top