windows store apps - Can the Path assigned a SQLite DB be an arbitrary value? -
In order to add an on-line method to the app, given some prerequisite code to start using SQLite in Windows Store apps Goes Xaml.cs:
// Get a reference to the SQLite database. DBPath = Path. Cobain (Windows.Storage.ApplicationData.Current.LocalFolder.Path, "customers.sqlite");
My question is, can I use any arbitrary value to change the "customers.sqlite" section or do something else in my code, such as my Name of the table definition category (In my case "Photocardia CCS", which according to the suggestion of Mr. Green, I added under a newly created "Model" folder)?
I understand, once I got those classes defined (I), and the above code in App.xaml.cs, with it (optimized for my SQLite classes):
< Using pre> (var db = new SQLite.SQLiteConnection (This.DBPath)) {// Create tables if they do not exist db.CreateTable & lt; PhotraxBaseData & gt; (); Db.CreateTable & LT; PhotraxNames & gt; (); Db.CreateTable & LT; PhotraxQueries & gt; (); }
... SQLite tables will be created based on those sections I specify, and they will be named "customers.sqlite" (provided I can not change it).
So, can I use it:
this.DBPath = path.combin (Windows.Storage.ApplicationData.Current.LocalFolder.Path, "platypus. Sqlite ");
... or something like this should be:
this.DbPath = path.comben (Windows.Storage.ApplicationData.Current.LocalFolder.Path, "PhotraxCoreData.sqlite");
The database name is just a filename The directory should be accessed by your app , But the name of the file can be anything.
Comments
Post a Comment