Reputation: 2808
Attempting to access an sqlite file over a shared folder.
(currently it is a default shared folder of Windows IOT)
string path = Settings.FullPathSQLite;
//path value is\\192.168.18.182\C$\Data\Users\DefaultAccount\AppData\Local\Packages\06fb6d66-31b3-4beb-893c-2e0d9fe465f1_3asabdzxmrwg6\LocalState\Project1\settings.sqlite
var conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), path);
throws error. but file location correct.
"Could not open database file: \\\\192.168.18.182\\C$\\Data\\Users\\DefaultAccount\\AppData\\Local\\Packages\\06fb6d66-31b3-4beb-893c-2e0d9fe465f1_3asabdzxmrwg6\\LocalState\\Portaokul\\settings.sqlite (CannotOpen)"
I can access files using StorageFile or StorageFolder classes. but cant figured it out how to modify SQLite Connection Path. have you any idea?
attaching network path to a drivename may allow accessing? so eg. "Z:\settings.sqlite" file is accesible via a normal desktop application. but not avaible for UWP.
Closest scenario I found is; copy file to local>modify>and upload back to network place. uwpc-copy-database-from-installed-location-to-local-folder
Upvotes: 0
Views: 908
Reputation: 4432
In UWP,apps can access certain file system locations by default, please refer to File access permissions in MSDN. Even though you can access folders out of your app private storage area,the SQLiteApi in UWP does not support for SQLite which expects a filename. Currently it seems no way to do this other than to copy your database to your UWP app local storage area.
Upvotes: 1