The most basic form of a SQLiteConnection string is "data source = ..."
I've tried a demo in which I had a SQLite database file called MyData.sdb, this file was placed right in my demo project folder tree (for example: DemoProject\MyData.sdb). And the following SQLiteConnection string worked:
"data source = MyData.sdb"
I could select tables OK. I even tried adding MyData.sdb to another child folder in my demo project folder (for example, DemoProject\Data\MyData.sdb) and the above connection string still worked? Wow, can't believe. But now is the most strange thing (against what I've experienced in the demo project):
When I tried another project and applied the same to it, it threw an exception called "No such table..." when I tried selecting a table which did exist in my SQLite database. It's so strange. I've doubted that it's for the incorrect path to the database file. And I've tried using the absolute path of the database file like this:
"data source = D:\\demo project\\MyData.sdb"
Then it worked, Why the hell did I use a relative path for my SQLite database file in the demo project well but can't apply in my new project?
I don't think it's easy, it needs your experience to explain. The strange thing may be in the demo project or in my new project, there should be one which worked abnormally.
Please help! Thank you!