Question Store DateTimePicker value to sql serve

tqmd1

Well-known member
Joined
Dec 5, 2009
Messages
60
Programming Experience
Beginner
Dear Experts

I have applied following custom Format to DateTimePicker

dd-MM-yyyy

So now DateTimePicker is displaying data as

15-01-2010

Sql server 2005, table1 has column named Date with datetime type

How to store DateTimePicker text into date column of Table1

I want to save only date not time as 15-01-2010

Please help
 
A Date value always contains also a time part, the custom format you mention if only for display purposes. If you want to store only the date part you can use the Date property of the Date value to have the time part reset to 0. DateTime.Date Property (System)
 
Back
Top