Hi everybody,
I'm using a masked textbox for my Date like this : 01/12/2010
Now the problem is, when the user uses a date with a leading 0, the masked textbox gives this 11/22/010_
So it skipped the leading 0 althought it is correct in my database.
This is the code I use to fill the masked textbox :
mtbShipDate.Text = Convert.ToString(dataRowData["ShipDate"]);
Please can somebody help me?
Thanks,
Tania
Loading
Suthish NairPosted Dec 11, 2010, 2:33 PM
refer article, might helps
Shahan AyyubPosted Dec 10, 2010, 10:25 AM
Can you please use DateTime.TryParse() Method:
like this:
DateTime dt;
Datetime.TryParse(dataRowData["ShipDate"],...........,dt);
then assign it:
mtbShipDate.Text = dt.ToString();