I have tried to test it
query.exec("SELECT id FROM plandfile WHERE id=(SELECT MAX(id) FROM plandfile)");
variant= query.value(0);// also try with 1
plandfileID=variant.toString();
QMessageBox::about(this, tr
("Value of ID"),plandfileID
);
QVariant variant;
QSqlQuery query;
query.exec("SELECT id FROM plandfile WHERE id=(SELECT MAX(id) FROM plandfile)");
variant= query.value(0);// also try with 1
QString plandfileID;
plandfileID=variant.toString();
QMessageBox::about(this, tr("Value of ID"),plandfileID);
To copy to clipboard, switch view to plain text mode
but I receive nothing in the QString.
I tested the SQL alone, works fine.
No Error but I m not sure why it's not working???
Bookmarks