使用SQLite
在本节的最后部分,我们将了解如何在 Windows Phone 应用程序中使用SQLite 执行一些基本操作。
创建表
首先为你的应用创建一张表。...Title", title);
values.put("Text", text);
long newRowId;
newRowId = db.insert("Post", null...SQLiteDatabase db){
String[] projection = {"Id", "Title", "Text" };
Cursor c = db.query("Post", projection, null..., null, null, null, null);
return c;
}
如果要根据 id 查找某条记录:
public async Task GetPost(int id)..., null, null);
return c;
}
更新记录
更新某条记录可以用下面的方法:
public async void UpdatePost(Post post)
{