//insert: public long insertinBalance(String new_bal1) { SQLiteDatabase db = helper.getWritableDatabase(); ContentValues contentvalues = new ContentValues(); contentvalues.put(VivzHelper.AVL_BALANCE, new_bal1); long id = db.insert(VivzHelper.BALANCE_TABLE, null, contentvalues); helper.close(); return id; } // retrieve column value public Cursor balance() { SQLiteDatabase db = helper.getReadableDatabase(); String[] columns = {VivzHelper.BAL_UID, VivzHelper.AVL_BALANCE}; Cursor c1 = db.query(VivzHelper.BALANCE_TABLE, columns,null , null, null,null,null); existing_bal = "0"; if(c1.getCount() > 0){ existing_bal = (c1.getString(1)); } else { } helper.close(); return c1;
if(c1.getCount() > 0){ existing_bal = (c1.getString(1)); }
if(c1.getCount() > 0){ existing_bal = (c1.getString(0)); // first element is index zero }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)