Select query of sqlite in metro app?

风格不统一 提交于 2019-12-11 19:05:48

问题


I have seen quite a number of examples describing the usage of SQLite in Metro app. Most of the examples have either Orderby/Insert/Delete statements. May I know how do I get the data from a pre-populated db using the Select statement?

Secondly, how does someone store the data into an array or arrayList after the execution of the query?

Kindly help me with this,

Thanks.


回答1:


See if this example is what you're looking for:

return db.runAsync('SELECT * FROM Table');

Here is a pretty useful article on it.

Extending the example to C#:

SQLiteAsyncConnection conn = new SQLiteAsyncConnection("people");
var query = conn.Table<Person>().Select();
var result = await query.ToListAsync();


来源:https://stackoverflow.com/questions/12633936/select-query-of-sqlite-in-metro-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!