Rank: Member Groups: Member
Joined: 11/18/2007 Posts: 18
|
c#, asp.net 2.0, ii6, visual studi pro v2005
I have a smalldatetime field in the sql 2005 server database record created.
The following script is trying to pull that smalldatetime value into the DatePicker control -- and wanting to display the date retrieved via this control. i.e. when the asp page loads up, it display any previously entered data entry (visibile via the DatePicker control).
This is not so, what I am doing wrong?
Thank you in advance for your time and efforts with this enquiry.
_____________________________________________________________
if (rdr[1] != DBNull.Value) { DatePicker_DateMovedToCurrent.SelectedDate = Convert.ToDateTime(rdr[1]); }
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
The only thing I can think of is that "rdr[1] != DBNull.Value" is evaluated as false. When that occurs, your code didn't change SelectedDate. So it retains whatever value that the user has previous entered.
Thanks
|