I'm working on a small project (my first MySQL one) and I got to a point where I'm coding a query to insert data in a table.
These are my variables:
float min=0, max=0, med=0, aux;
string data, stringTipo, stringPapel, stringCompanhia;
I converted the std::strings to System::strings using:
String^ sCom = gcnew String(stringCompanhia.c_str());
String^ sTipo = gcnew String(stringTipo.c_str());
String^ sPap = gcnew String(stringPapel.c_str());
String^ sDat = gcnew String(data.c_str());
This is my query:
MySqlCommand^ cmdDataBase=gcnew MySqlCommand("insert into bdi.acoes (companhia,papel,tipo,min,max,med,data) values('"+sCom+"','"+sPap,+"','"+sTipo+"','"+min+"','"+max+"','"+med+"','"+sDat+"');",conDataBase);
As of now, I'm working on a query to insert data
, stringTipo
, stringPapel
, stringCompanhia
, min
, max
and med
into my acoes
table.
For now I got errors related to the floats only, I do BELIEVE that my string conversion is rather fine for inserting data into my query, but any suggestions are welcome.
These are the errors I'm getting (note: all of them are the same for all floats).
error C2678: binary '+' : no operator found which takes a left-hand operand of type 'const char [4]' (or there is no acceptable conversion)