Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 'order (service,price,billno,dates) VALUES ('WASH (L)','13','BILL-00002','2015-11' at line 1
- string a,b;
- foreach (DataGridViewRow row in dataGridView1.Rows)
- {
- a = dataGridView1.Rows[row.Index].Cells["Service"].Value + "";
- b = dataGridView1.Rows[row.Index].Cells["Price"].Value + "";
- string query1 = "INSERT INTO order (service,price,billno,dates) VALUES (@1,@2,@3,@4)";
- MySqlCommand cmd1 = new MySqlCommand(query1, con);
- cmd1.Parameters.AddWithValue("@1", a);
- cmd1.Parameters.AddWithValue("@2", b);
- cmd1.Parameters.AddWithValue("@3", label15.Text);
- cmd1.Parameters.AddWithValue("@4", label17.Text);
- cmd1.ExecuteNonQuery();
- }
- con.Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement