How to INSERT date into SQL database date column using dateTimePicker?

前端 未结 5 1599
暗喜
暗喜 2020-12-16 08:38

I have a birthdate column of type Date in sql database

And in my application I use a dateTimePicker to get the birth date

But when

5条回答
  •  庸人自扰
    2020-12-16 09:30

    Try this as string format:

    cmd.CommandText="INSERT INTO person(birthdate)VALUES('"+dateTimePicker.Value.Date+"')";
    

提交回复
热议问题