I want to insert multiple rows into my database, I tried to use parameters but I did something wrong.
In debug mode, the parameters do have values, but once the insert is done, I still have @compte, @mo, @userimp in my database instead of their values.
string INSERTDELAMORTPart2 = "'123'," + "'@compte'" + "," + "'@mo'" + "," + "'ubs'" + "," + "'2'" + "," + "'@userimp'" + "," + "'22.10.17'" + ",'";
OdbcCommand Query = new OdbcCommand(INSERTDELAMORTPart2, InfoConnexion);
Query.Parameters.AddWithValue("@compte", _cb_Compte.SelectedItem);
Query.Parameters.AddWithValue("@mo", MondantResultat);
Query.Parameters.AddWithValue("@userimp", UserImp);
Query.ExecuteNonQuery();
I have tried Parameters.Add, and also Parameters["@name"].Value, but the result stays the same.
What am I doing wrong ?
EDIT :
I have an Oracle database and I need the single quote to insert my values. I have tried to pass my whole INSERT string into a parameter but it doesn't work.
I'm about to give up and just replace the ' by '' even if it's a bad idea.