Hello prasad1001
First of all, sorry for my english.
you have set the database name as "hari", so try this:
db.setDatabaseName("hari");
...
db.open();
...
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("hari");
...
db.open();
...
QSqlQuery query(db);
To copy to clipboard, switch view to plain text mode
or
QSqlQuery query(QSqlDatabase::database("hari", false));
To copy to clipboard, switch view to plain text mode
in elsewhere.
false makes it not open a new database even if the database named "hari" does not exist.
Bookmarks