date from MySql into text box dropping leading zeros
I have search for some time but can't find an answer to this one. I am using vb.net and the app is a Window's Form app and MySql Connector/Net 1.0.3. I have a dob column as date in my table. Using a combobox to select an employee's name, it returns that info to various textboxes in the form. Problem I am having is with the dob column. I have a masked text box for dob ##-##-#### to force the user to enter a certain pattern. When the box is filled from the db, if there are leading zeros say in the month or day then they get dropped. So it screws up the display of that date. For instance coming from the db to the textbox it drops leading zeros so a dob of 05-15-1966 would look like 51-51-966 in the dob textbox.
My select statement for this populate the form is just select * from emp.
On the selectchange of the combo it populates the form. For the dob it is just:
txtMaskDob.Text = rowSel("dob").ToString
You can't cast from mysqldate to date and I have tried a couple of other coverts.
Anyone know of a way to keep those leading zero's there?
Thanks
tk
Subject
Written By
Posted
date from MySql into text box dropping leading zeros
January 08, 2005 02: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.