con.setDatabaseName(_DB);
con.open();
// the problem occur ins some cases with different data types, like integer directly (0), query2 return and text from qlineedit, as with diferent object types (qlineedit, qcombobox, qcheckbox)
query.prepare("UPDATE table SET id_country=:id_country, id_city=:id_city, name=:name ...... WHERE id=:id"
query.bindValue(":id_country",1);
query.bindValue(":id_city",query2.value(0).toInt());
query.bindValue(":name",ui->QLineedit->text());
.
.
.
query.bindValue(":id",_ID);
query.exec();
QSqlDatabase con = QSqlDatabase::addDatabase("QSQLITE");
con.setDatabaseName(_DB);
con.open();
QSqlQuery query;
// the problem occur ins some cases with different data types, like integer directly (0), query2 return and text from qlineedit, as with diferent object types (qlineedit, qcombobox, qcheckbox)
query.prepare("UPDATE table SET id_country=:id_country, id_city=:id_city, name=:name ...... WHERE id=:id"
query.bindValue(":id_country",1);
query.bindValue(":id_city",query2.value(0).toInt());
query.bindValue(":name",ui->QLineedit->text());
.
.
.
query.bindValue(":id",_ID);
query.exec();
To copy to clipboard, switch view to plain text mode
Bookmarks