我的通用8.1应用程序中有SQlite。当我运行Windows 8.1应用程序时,它运行良好但是当我运行我的Windows手机应用程序时,我得到错误SQlite忙 这是我的代码:
private async void getSQLiteDataBase()
{
SQLiteAsyncConnection conn;
conn = new SQLiteAsyncConnection("Setting.db");
var ListIndex = await conn.Table<SettingTable>().Where(x => x.Name == "ColorSettingIndex").FirstOrDefaultAsync();
var AlertPercent = await conn.Table<SettingTable>().Where(x => x.Name == "DataPlanAlertPercent").FirstOrDefaultAsync();
var UpdateTimeIndex = await conn.Table<SettingTable>().Where(x => x.Name == "UpdateTimeIndex").FirstOrDefaultAsync();
var NotificationIsEnabled = await conn.Table<SettingTable>().Where(x => x.Name == "NotificationIsEnabled").FirstOrDefaultAsync();
var FirstNotification = await conn.Table<SettingTable>().Where(x => x.Name == "FirstNotification").FirstOrDefaultAsync();
var SecondNotification = await conn.Table<SettingTable>().Where(x => x.Name == "SecondNotification").FirstOrDefaultAsync();
var ThirdNotification = await conn.Table<SettingTable>().Where(x => x.Name == "ThirdNotification").FirstOrDefaultAsync();
var TilesIsEnabled = await conn.Table<SettingTable>().Where(x => x.Name == "TilesIsEnabled").FirstOrDefaultAsync();
if (ListIndex != null && AlertPercent != null && UpdateTimeIndex != null &&
NotificationIsEnabled != null && FirstNotification != null
&& SecondNotification != null && ThirdNotification != null && TilesIsEnabled != null)
{
....
}
}
有可能帮助我吗? 注意:我之前搜索过,发现我必须关闭数据库但是在Windows通用8.1上没有关闭我的数据库的属性。我在Windows上看到了SQlite的例子,他们没有关闭数据库的任何代码 我很抱歉英语不好 谢谢。