DateTimePicker - How to save date into the DB?

May 30 2008 2:02 AM

Dear Friends,

I need to save date format which displays in the dateTimePicker1 in the  window form. The date format in the dateTimePicker1 is like this "Friday, May 30, 2008".

But when i'm trying save this format into the database there is an error displaying saying that, nvarchar datatype cannot covert into datatime.

// the given below cade generate the error...

enterDate = dateTimePicker1.Text; //enterDate  is the variable name that I have defined

Could you please help me to solve this problem?

Thanks in advance.


Answers (5)