我的sqlite更新操作有问题,请帮我解决一下 这是我更新数据的数据库处理程序:
public int updateAccountCalc(Accounts accounts) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(KEY_ID, accounts.getId());
values.put(KEY_NAMA, accounts.getNama());
values.put(KEY_EMAIL, accounts.getEmail());
values.put(KEY_BB0, accounts.getBB0());
values.put(KEY_BB1, accounts.getBB1());
values.put(KEY_BB2, accounts.getBB2());
values.put(KEY_BB3, accounts.getBB3());
values.put(KEY_LILA, accounts.getLila());
// updating row
return db.update(TABLE_NAME, values, KEY_ID + " = ?",
new String[] { String.valueOf(accounts.getId()) });
}
这是使用它的代码:
db.updateAccountCalc(new Accounts(0, nama.toString(), email.toString(), bb, 0, 0, 0, lila));
我已经插入了bb的值,但是从未在sqlite数据库中更新