javier
- Forum posts: 2
Dec 13, 2011, 6:58:28 AM via Website
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!
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!
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.