Probl insertion date dans db mysql(odbc)
Bonjour,
J'écris ma requête d'insertion comme suit:
Code:
1 2 3 4 5 6 7 8
| protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
{
DateTime date = (DateTime)e.Values["Annee_de_production"];
SqlDataSource1.InsertCommand = (
"INSERT INTO films(Titre,Annee_de_production) VALUES " +
"(' " + e.Values["Titre"].ToString() + " '," +
"(' " +date.Year+"-"+date.Month+"-"+date.Day+" ');"); |
Malheureusement, j'ai une erreur lors que j'insére. C'est la date qui pose problème.
Citation:
ERROR [23000] [MySQL][ODBC 3.51 Driver][mysqld-5.0.27-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
J'ai essayé plusieurs solutions mais aucunes ne marchent.
Comment faire ?
Merci d'avance