Witam
Mój problem wygląda następująco:
do tego kodu chciałbym wstawić dane z textboxa, z właściwości "text".
próbowałem to zrobić w ten sposób:
//konwersja na *const char
marshal_context ^context = gcnew marshal_context();
rej_login = context->marshal_as<const char*>(textBox2->Text);
marshal_context ^context1 = gcnew marshal_context();
rej_haslo = context1->marshal_as<const char*>(textBox3->Text);
//wstawianie danych do bazy
mysql_query(conn,"INSERT INTO `baza`.`tabela` (`Login` ,`Haslo`)VALUES ('"+rej_login+"', '"+rej_haslo+"');");
lecz kompilator wywala błąd:
error C2679: binary '+' : no operator found which takes a right-hand operand of type 'const char *' (or there is no acceptable conversion)
1> could be 'built-in C++ operator+(volatile const System::Object ^, volatile const System::String ^)'
1> or 'built-in C++ operator+(volatile const System::String ^, volatile const System::Object ^)'
1> or 'built-in C++ operator+(volatile const System::String ^, volatile const System::String ^)'
1> while trying to match the argument list '(System::String ^, const char *)'
Proszę o pomoc, nie wiem jak rozwiązać ten problem. Używam Visual studio 2010 i języka c++.