问题
I have created SQLite database and have copied it in the root of the project like that:
The database is called MobileSell.db It appears in Visual Studio like that:
My question is how can I reference it so afterwards I can say connection.InsertIntoTableArticles(value)(this is pseudo code)
回答1:
You can refer to this.
There only three steps to achieve it:
1) Create Assets
folder which is parallel with Resources
folder in your project, put your .db
file into it.
2) Copy the .db file to SDCard when first open the app;
3) Use SQLite.SQLiteConnection(path)
to open your .db and query it.
来源:https://stackoverflow.com/questions/48226088/how-to-reference-sqlite-database-that-already-exists-in-xamarin-android