[WP 8.1] [C#]使用SQLite.Net.Async.SQLiteAsyncConnection问题。 [英] [WP 8.1][C#] Using SQLite.Net.Async.SQLiteAsyncConnection Questions.
本文介绍了[WP 8.1] [C#]使用SQLite.Net.Async.SQLiteAsyncConnection问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
有人可以告诉我这里的代码是否正确吗?我正在使用SQLite.Net.Async-PCL库的异步版本。
Hello all,
Could someone advise whether the code I have here is right or not? I am using the async version of SQLite.Net.Async-PCL library.
using SQLite.Net;using SQLite.Net.Async;using SQLite.Net.Attributes;
string databasePath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "Scheduler.sqlite");
public static SQLiteAsyncConnection db;
var conFunction = new Func<SQLiteConnectionWithLock>(() =>
new SQLiteConnectionWithLock(new SQLitePlatformWinRT(),
new SQLiteConnectionString(databasePath, false)));
var connectionString = new SQLiteConnectionString(databasePath, false);
var connectionWithLock = new SQLiteConnectionWithLock(new SQLitePlatformWinRT(), connectionString);
db = new SQLiteAsyncConnection(() => connectionWithLock);
此代码不显示任何红色波浪形,但它不起作用。
This code doesn't show any red squiggly's, but it doesn't work.
var existing = await App.db.QueryAsync<Schedule>("select * from Schedule where Date = ? order by ShiftStart", theWeek.AddDays(i));
上面的行在try语句中,当编译器命中这一行时,它会进入catch块。我很漂亮查询语句没有任何问题,因为我在其他SQLiteAsyncConnection库中使用它。请告知?
The above line is inside a try statement, the moment the compiler hits this line, it goes to the catch block. I am pretty there is nothing wrong with the Query Statement as I was using this with the other SQLiteAsyncConnection library. Please advise?
谢谢,Sumesh
推荐答案
什么是例外?
这篇关于[WP 8.1] [C#]使用SQLite.Net.Async.SQLiteAsyncConnection问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文