using sqlite database with qt
- by Lakshan Perera
here is my code, it dont seems enything wrong,
QSqlDatabase db=QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("thedata.sqlite");
db.open();
QSqlQuery quary;
quary.prepare("SELECT lastname FROM people where firstname='?' ");
quary.bindValue(0,lineEdit->text());
bool x=quary.exec();
if(x){
//......
}
else {
QSqlError err;
err=quary.lastError();
QMessageBox::about(this,"error",err.text() );
}
when the program is working always it gives the error parameter count mismatch im using qt 4.8 and its own headers for using sqlite.
I would be very thankful for eny advice, though I searched in google i see many posts in this issue but nothing helped me.
thank you.