스프링노트

[C#] datetimepicker Mysql에 넣기 본문

DEVELOPMENT/C/C++

[C#] datetimepicker Mysql에 넣기

RAYZIE 2013. 7. 18. 21:59


Mysql 필드형은 DateTime

dateTimePicker.Value.ToString("yyyyMMdd");

자동으로 변환되서 들어간다.


As stated in the title. 
I tried 

Convert.ToDateTime(dtpDate.Value.ToString())


but it is giving me an error that it is in incorrect format.
I also tried 

Date = String.Format("yyyy/MM/dd", dtpDate.Value.ToString())


but still no luck. I hope someone could help me.

Thanks.


&&&& birthEdit.Value.ToString("yyyyMMdd");