简体   繁体   中英

Store a SQLite Database to local filesystem from a windows 8.1 App

I have made a Windows 8 store App. I want to make a SQLite database inside it, which can be stored on a filesystem on my computer ,in a location like "C:/My Documents/File.sqlite". I am unable to figure out how to do that. Can anyone please suggest a way to do that. Thanks in advance.

The ultimate purpose is to read the database file from an external windows service. The windows service is unable to read from the App's local storage folder. If there is any way to do that, that could also work.

The database will be stored in the app's local data and you can update your DB from there.

Path : C:\Users\sunilkumar.s\AppData\Local\Packages\"Your App Package"\LocalState\

You can access this in c# using this code

string strPath = ApplicationData.Current.LocalFolder.Path;
string strDatabaseName = "ABCD.db";
strFinalPath = System.IO.Path.Combine(strPath, strDatabaseName);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM