Re: date from MySql into text box dropping leading zeros SOLVED
Posted by: Terri Kelley
Date: January 09, 2005 05:59PM

I wasn't sure if this was a deal with MySql, the connector or .NET. I guess it is with .NET where the leading 0 is dropped in a string? Found the same to be true when hashing a password. If the hex value had a leading 0 then it got dropped so had to code for that. Anyway, back to this problem, I finally solved it by the following code:
Dim mydate As Date = Convert.ToDateTime(rowSel("dob").tostring)
Dim mydatedob as String = mydate.ToString("MMddyyyy")
txtMaskDob.Text = mydatedob
That displayed the date correctly. Maybe the long way to do it but it works.

tk

Options: ReplyQuote


Subject
Written By
Posted
Re: date from MySql into text box dropping leading zeros SOLVED
January 09, 2005 05:59PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.