"no such table: CityType"
I think this sentence is clear enough.
"no such table: CityType"
I think this sentence is clear enough.
I told you the likely problem here. You don't have a table called CityType, so you cannot query it. Pretty simple really. If you don't understand why you don't have a table called CityType given the database creation code I referenced then there is little we can do to help.
From your earlier post http://www.qtcentre.org/threads/41747-Sqlite-data-base
Qt Code:
QSqlQuery query; query.exec("create table person (Id int primary key,name varchar(20), typeid int)"); query.exec("insert into person values(1, 'Delhi',101)"); query.exec("insert into person values(2, 'Gurgaon',102)"); query.exec("insert into person values(3, 'Noida',103)"); query.exec("insert into person values(4, 'Gaziabad',104)"); query.exec("insert into person values(5, 'faridabad',105)"); //! [Set up the main table]To copy to clipboard, switch view to plain text mode
I am more confused how you go from "My query executed" with no error in your posts 9 and 10 of this thread, to this this very specific and informative error message. Are you working through this thing in any sort of methodical matter, or are you thrashing around in the hope that eventually you will get lucky, or someone will succumb and fix your code and post a complete implementation? The first approach will give you an understanding, the second and third will leave you with similar problems in a few days/months/years time and no idea how to deal with them.
Take a step back from the code, look at what you are trying to achieve and write down in English/your native tongue the broad things you need to achieve to get there. Then break each down into smaller, more specific things, until each item is a manageable, small bit of C++/SQL/shell script code or manual activity. Then work through each in turn, making sure it works before moving on.
Bookmarks