sqlitedatabase update
I'm currently trying to update a row using the sqlitedatabase.update
method here:
Heres the cod开发者_如何学Goe that I have:
public int udpateStockInfo(String stock, double qty, double purchasePrice){
ContentValues val = new ContentValues();
val.put(KEY_QTY, qty);
val.put(KEY_PURCHASE_PRICE, purchasePrice);
return db.update(DB_TABLE, val, KEY_STOCKNAME + "=?", new String[]{stock});
}
Right now I'm getting an error on the last return line. Can anyone help me with it? The IDE is saying there is a syntax error on tokens, misplaced constructs.
as noted above gotta make sure its' a new String[]
精彩评论