views:

34

answers:

1

I am developing windows mobile application. I have added the SQLite database file in my project by using the Add Existing Item in visual studio. It gets deployed in the windows mobile emulator. I am also able to connect to the SQLite database through C#. When I perform the operations select, insert etc on the table of the SQLite database file, it is giving error there is no such table. I can see the SQLite database file deployed in the device by browsing the program files in the emulator device. I am not able to see the table as the hierarchical item under the SQLlite database file both in the project solution explorer & the emulator. When I add the SQL server compact database I can see the table as a hierarchical item under the database file in server explorer. I can also see the table as a hierarchical item under the database file(SQL Server Compact) in the emulator once I deploy my project on the emulator when I use the SQL Server Compact database. Where I am going wrong in the case of SQLite database? Why It is giving the error "there is no such table ..." ? How to slove this problem? Can you please provide me any suggestion or link through which I can solve the above issue?

A: 

Your problem might be a wrong database path in the connection string. That way SQLite will connect to a non-existing file, and create a totally empty database on connect.

If this is not the case, and it is really a deployment problem, as a workaround if your database contains only empty tables at the beginning you could create the database file with the given structure from your program and not deploy the database at all.

ytg