Welcome Guest Search | Active Topics | Sign In | Register

Bind to DatePicker control Options
piyush
Posted: Thursday, November 11, 2010 7:24:52 AM
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.
eo_support
Posted: Thursday, November 11, 2010 8:00:44 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You should bind to SelectedDateString instead of SelectedDate property.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.