Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 现有SQLite数据库不能由SQLite net PCL使用_C#_Sqlite - Fatal编程技术网

C# 现有SQLite数据库不能由SQLite net PCL使用

C# 现有SQLite数据库不能由SQLite net PCL使用,c#,sqlite,C#,Sqlite,我正在尝试创建一个图书馆应用程序,供最终用户借出和预订图书,我有一个SQLite数据库,其中包含两个表——一个用于“Book”,另一个用于“user”。我试图从一个完整的SQL客户机接口切换到一个本地数据存储概念,但是,我试图使用SQLite net PCL。但对于一个我知道存在并且是我使用SQLiteStudio创建的SQL数据库的文件,我始终会遇到“无法打开”错误。这是给出错误背后的错误的代码: 代码 public static void InitializeDatabase ()

我正在尝试创建一个图书馆应用程序,供最终用户借出和预订图书,我有一个SQLite数据库,其中包含两个表——一个用于“Book”,另一个用于“user”。我试图从一个完整的SQL客户机接口切换到一个本地数据存储概念,但是,我试图使用SQLite net PCL。但对于一个我知道存在并且是我使用SQLiteStudio创建的SQL数据库的文件,我始终会遇到“无法打开”错误。这是给出错误背后的错误的代码:

代码

public static void InitializeDatabase ()
    {
        db = new SQLiteConnection(DependencyService.Get<IDataBaseHelper>().GetLocalFilePath("hogwartslibrary.db"));
    }
错误

An exception of type 'SQLite.SQLiteException' occurred in SQLite-net.dll but was not handled in user code
Could not open database file: \Assets\database\hogwartslibrary.db (CannotOpen)

我确信数据库正在与应用程序打包,我也确信数据库可以正常工作。问题似乎要么在库中,要么在我的C代码中。你们能帮帮我吗?

从异常的部分路径看,ApplicationData.Current.LocalFolder.path是空的?@AlexK。可能是因为我正在通过VisualStudio运行它,而没有安装appxSorry,对这个工具链一无所知。
An exception of type 'SQLite.SQLiteException' occurred in SQLite-net.dll but was not handled in user code
Could not open database file: \Assets\database\hogwartslibrary.db (CannotOpen)