Rank: Newbie Groups: Member
Joined: 11/11/2010 Posts: 1
|
Hello
I am using DatePicker control. I have bind value from my databse to control as below.
<eo:DatePicker ID="txtStartTime" runat="server" PickerFormat="dd/MM/yyyy hh:mm tt" SelectedDate='<%#Bind("StartTime") %>' />
But problem is that when database return null value at that time it gives error. Conversion from string DBNull to type 'Date' is not valid.
It means i can not bind null or blank value to datepicker. Please let me know how to resolve this.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You should bind to SelectedDateString instead of SelectedDate property.
Thanks!
|