db.update problem!

  • Replies:0
javier
  • Forum posts: 2

Dec 13, 2011, 6:58:28 AM via Website

Hello, Im trying to update my database by the following lines of codes:

private static final String key_Id = "com_Id";

public void updateComment(int comId, int condId, String Comm) {

db.beginTransaction();

try {
ContentValues values = new ContentValues();
values.put("cond_Id", condId);
values.put("comment", Comm);
db.update(condition_Table, values, key_Id+"="+comId, null);
db.setTransactionSuccessful();
Log.d("tag_update", "Update successful!"+comment);

} catch (Exception e) {
Log.e("Error in transaction", e.toString());

} finally {
db.endTransaction();
}

}

It does not generate any error for me, log.d shows update successfully but in my database, there no changes... Im not sure whats the problem, need advise!

Reply