I am trying to insert a record to a mysql database using c# but I always saw this error message:
You have error in your SQL syntax;check the manual that corredponds to your MySQL server version for the right syntax to use near 'Order(idOrder, Quantity, Date, Menu_idMenu)VALUES(10002, '1', '3/17/2013 12:00' at line 1
this is the code:
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if (!row.IsNewRow)
{
com.CommandText = "INSERT INTO Order (idOrder, Quantity, Date, Menu_idMenu) VALUES (" + 10002 + ", '" +row.Cells[0].Value.ToString() + "', '"+DateTime.Today.ToString()+"', '" + row.Cells[1].Value.ToString() + "')";
int insert = com.ExecuteNonQuery();
}
}
what does it mean?