Hi ElmoWatson,
We have a couple suggestions.
Option 1. How about adding the frmCalDate and frmCalTime together and then storing into one database field? Based on your code provided this would be simple, just set the TimePicker property of the DatePicker with the id of the TimePicker and you should be good to go. Example:
<BDP:BasicDatePicker ID="frmCalDate" runat="server" TimePicker="frmCalTime" /> <BDP:TimePicker ID="frmCalTime" runat="server" />
Once you set the TimePicker property, the two controls are linked and the SelectedDate property will automatically handle setting/getting of the SelectedTime. The date picker will add the two values together and return one DateTime value. Your frmCalDate field will now contain both the Date & Time values.
If you have null/DBNull values in your database, you could bind to the SelectedValue property. The SelectedValue property will properly handle any null values, whereas the SelectedDate property requires a DateTime object, which can not be null.
Option 2. Change the frmCalTime field in the database to accept a string instead of a Date and then set/get the SelectedValue property of the TimePicker. The SelectedValue property "should" automatically convert the time value string into a TimeSpan object. The SelectedValue property will return an Object, so just get .SelectedTimeFormatted when filling your @CalTime SQLParameter. Example:
.Add(New SQLParameter("@CalTime", frmCalTime.SelectedTimeFormatted))
Calling .ToString on the SelectedTime should also work. Example:
.Add(New SQLParameter("@CalTime", frmCalTime.SelectedTime.ToString()))
Option #1 above is definitely preferred over option #2.
I hope this helps answer your question.
I apologize for the late response to your support request. We've been swamped coming off the holidays and preparing for our version 1.3 release, which we released yesterday.
We would highly recommend upgrading to version 1.3 of the controls if you have not already done so. You can download our latest installer or manual installation package at
http://www.basicdatepicker.com/download/
Thanks,
Geoffrey McGill
----------------------------------------
Coolite Inc.
Email: support [at] coolite [dot] com
Phone: +1(888)775-5888