I m trying to save the date to mysql from jquery *DatePicker* from C#
string datetime = txtDate.Text + " " + time;//05/11/2011 5:30 pm
string getSQL1 =
"INSERT into tblconcertdetail
(Address, City, Pincode, Country, Concert_Date)
VALUES ('" + addr + "','" + txtCCity.Text + "','" + txtCpincode.Text + "','" +
ddlCCountry.SelectedItem.Text + "','" + Convert.DateTime(datetime) + "')";
Here getsql1 shows me the date field filled but in database it stores 0000-00-00 00:00 value.
I m not getting why it is so.
I also try convert.ToString(datetime) to.
As mentioned in comments, you have to use parameters for 2 reasons:
DateTimetype to its equivalent value in database.