I am trying to implement a database in my Windows 8.1 Modern UI application. I did this for the Windows Phone 8.1 application successfully, but it does not work in the new Windows 8.1 application.
I received SQLiteExceptionwith a message Could not open database file: MyAppBase.db (CannotOpen)when I installSQLiteConnection
public static DatabaseHelper Instance
{
get
{
if (_instance == null)
{
_instance = new DatabaseHelper();
}
return _instance;
}
}
public DatabaseHelper()
{
_connection = new SQLiteConnection(DATABASE_NAME);
_connection.CreateTable<UserEntity>();
}
I perform the following actions: Added “sqlite-net” link to Nuget link, checked “SQLite for Windows Runtime (Windows 8.1)” and “Microsoft Visual C ++ 2013 Runtime Package for Windows” in project links, Targetted build to x86.
How can I make this work?
source
share