我试过这个命令:
List<Person> find_person = database.Query<Person>("Select * from Person where person_name like '%"+textbox.tex+'%" or person_surname like '%"+textbox.tex+'%" ");
但是你知道这种方式并不安全。有没有办法执行这个命令?
Ex:在插入操作中,我可以这样做;
Person person = new Person();
我将设置所有值并使用connection.InsertAsync(person);
我的select和like命令有什么功能吗?
答案 0 :(得分:0)
桌面上的简单Where查询怎么样:
SQLiteAsyncConnection conn = new SQLiteAsyncConnection("people");var query = conn.Table<Person>().Where(x => x.Name == "Matteo");
var result = await query.ToListAsync();
foreach (var item in result)
{
Debug.WriteLine(string.Format("{0}: {1} {2}", item.Id, item.Name, item.Surname));
}
在此处阅读更多内容:http://wp.qmatteoq.com/using-sqlite-in-your-windows-8-metro-style-applications/