| | | Forum Newbie
       
Group: Forum Members Last Login: 8/20/2010 2:20:01 PM Posts: 2, Visits: 15 |
| hi dear
i am new to vb.net , and i want to add date and time (DateTimePicker1) to my form
then when i save the record a wrong date is saved to the table , my database is sql 2005
Code: " & Format(DateTimePicker1.Value, "dd/mm/yy") & ") "
Result: 1/1/1900 12:00:00 AM
i much liked to help.............
amaan |
| | | | Forum God

Group: Moderators Last Login: Yesterday @ 1:42:32 PM Posts: 1,073, Visits: 9,408 |
| | not sure if this is right DateTimePicker1.Value.ToString("dd/mm/yy") you will probably do better posting in the Visual Basic .NET forum |
| | | | Forum Newbie
       
Group: Forum Members Last Login: 8/20/2010 2:20:01 PM Posts: 2, Visits: 15 |
| hi
i had tried this code
DateTimePicker1.Value.ToString("dd/mm/yy")
but still not solved to my problem and producing same result:1/1/1900 12:00:00 AM
for any time to save record.
i hope help
amaan |
| | | | Forum Newbie
       
Group: Forum Members Last Login: 11/9/2011 3:37:49 PM Posts: 5, Visits: 6 |
| You can do something like this In design time you can change the format to Short Date Format(DateTimePicker1.Value, "dd/MM/yy") Hope this helps |
| | | | Forum God

Group: Moderators Last Login: Yesterday @ 1:42:32 PM Posts: 1,073, Visits: 9,408 |
| | how about Convert .ToDateTime(DateTimePicker1.Value) EDIT: Never mind...I just noticed the date. |
| |
|
|