I'm trying to implement a database in my Windows 8.1 Modern UI application. I made this for a Windows Phone 8.1 app successfully, but it doesn't work in a new Windows 8.1 app.
I got a SQLiteException
with message Could not open database file: MyAppBase.db (CannotOpen)
when i instanciate SQLiteConnection
public static DatabaseHelper Instance
{
get
{
if (_instance == null)
{
_instance = new DatabaseHelper();
}
return _instance;
}
}
public DatabaseHelper()
{
_connection = new SQLiteConnection(DATABASE_NAME);
_connection.CreateTable<UserEntity>();
}
I follow this steps : Added 'sqlite-net' to Nuget reference, Checked 'SQLite for Windows Runtime (Windows 8.1)' and 'Microsoft Visual C++ 2013 Runtime Package for Windows' on project references, Targetted build to x86.
How can i get this working ?