sqlite db update

后端 未结 8 1697
暗喜
暗喜 2020-12-11 09:14

Is there an easy way to update a table in sqlite in android? (like a single line in built method) ? I have a table with few columns and primary is one column. I want to sear

8条回答
  •  情书的邮戳
    2020-12-11 09:16

    Then you should already know what's your primary key.

    dbHelper.getWritableDatabase();
    ContentValues values = createContentValues(profileVo);
    db.update(ProfileVO.TABLE_NAME, values, ProfileVO.COLUMN_ID + "=" + profile.getId(), null)
    

    Here's a good tutorial for you http://www.vogella.com/articles/AndroidSQLite/article.html

提交回复
热议问题