开发者

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[]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜