Date Insert Problem in mySQL

J

Jassim Rahma

Hi,

I am using C# to insert a date value from the DatePicker into a DateTime
filed in mySQL database.. I am using the following syntax:

'" + datePicker.Value + "'


I also triend it withour the ' and with #


in the best scenario I will not get any error but the value will not be
saved in the database, so if I have 10 different values of string,
numeric & date then everything will be inserted successfully except the
date value which will not be inserted and will not return any error
message..


can anyone help please.....

Many Thanks,
Jassim Rahma
 
M

Mark Rae

I am using C# to insert a date value from the DatePicker into a DateTime
filed in mySQL database.. I am using the following syntax:

'" + datePicker.Value + "'

Does this fix it...?

'" + datePicker.Value.ToString("yyyy/MM/dd") + "'
I also triend it withour the ' and with #

It needs the apostrophe, not the hash.
 
J

Jassim Rahma

Thank you very much...


my problem is solved with your answer...



Many Thanks,
Jassim Rahma
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top