I have a SQLite database from another project and I want to use it in a UWP application. But I don't know how to import this database to the project and!
相关问题
- SQL/SQL-LITE - Counting records after filtering
- What SQLite NuGet package do I need
- How to write the array into the sqlite database fo
- Microsoft store certification fails due to DPI awa
- Groupwise MAX() on a subquery
相关文章
- SQLite不能创建表
- 小型数据库(SQLite,Derby,H2)可以存储多少数据?
- sqlite char数据类型 长度问题
- How to create a MediaClip from RenderTargetBitmap
- Sqlite: How do I reset all database tables?
- How to overlay items in StackPanel or ListView?
- C# UWP Toolkit DropShadowPanel inner shadow
- 请问SQLite 搭配甚么协议、技术可以达到远端连线并保持 Transaction 等功能
For how to access an exist file, there are two locations that all apps can access. Details please reference the file-access-permissions.
One is
Application install directory
. As @Henk Holterman said, you can import your existed database file into your project by right-click one folder and select Add->Existing item to add your database file to the project. Pay attention the file'sBuild action
property need to be set tocontent
. Details please see the following picture.Suppose you already had a database file
Sun.db
added to the Assets folder, and now you can connect to it by the following code( use the SQLite.Net-PCL Nuget Package).But this folder is read only. Another location is
Application data locations
which can read/write. You can copy the database file from install directory to the application data directory for using. The following code example is for connecting a database file that in the local folder.