我正在尝试在我的 Windows 8.1 Modern UI 应用程序中实现一个数据库。我成功地为 Windows Phone 8.1 应用程序制作了这个,但它不适用于新的 Windows 8.1 应用程序。
我实例化时收到一条SQLiteException
消息Could not open database file: MyAppBase.db (CannotOpen)
SQLiteConnection
public static DatabaseHelper Instance
{
get
{
if (_instance == null)
{
_instance = new DatabaseHelper();
}
return _instance;
}
}
public DatabaseHelper()
{
_connection = new SQLiteConnection(DATABASE_NAME);
_connection.CreateTable<UserEntity>();
}
我按照以下步骤操作:在 Nuget 参考中添加了“sqlite-net”,在项目参考中检查了“SQLite for Windows Runtime (Windows 8.1)”和“Microsoft Visual C++ 2013 Runtime Package for Windows”,目标构建为 x86。
我怎样才能让这个工作?