SQLite - Could not open database file SQLite - Could not open database file sqlite sqlite

SQLite - Could not open database file


Does the path folder path that you are providing to SQLite exist? If you haven't created the CanFindLocation folder then opening a connection to that path will fail.

Try:

string applicationFolderPath = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "CanFindLocation");// Create the folder path.System.IO.Directory.CreateDirectory(applicationFolderPath);string databaseFileName = System.IO.Path.Combine(applicationFolderPath, "CanFindLocation.db");SQLite.SQLite3.Config(SQLite.SQLite3.ConfigOption.Serialized);var db = new SQLiteConnection (databaseFileName);


My problem is related to added the option of "SQLiteOpenFlags.Create" during the initialization.

SQLiteAsyncConnection database = new SQLiteAsyncConnection(dbPath, SQLiteOpenFlags.Create);