我正在使用 SQLite,插入到表中。跟随
QSqlQuery testQuery(QString("INSERT INTO test(testcol) VALUES(?)"));
testQuery.bindValue(0, someQStringObg);
testQuery.exec();
有效,但是
QSqlQuery testQuery(QString("INSERT INTO test(testcol) VALUES(:val)"));
testQuery.bindValue(":val", someQStringObg);
testQuery.exec();
不。testQuery.lastError().text() 返回无查询无法获取行
不知道为什么会这样,但真的很想知道。