Android SQLite Update not working

前端 未结 4 701
野趣味
野趣味 2020-12-11 08:48

I am trying to update one column for any number of rows.

Here is the function:

public void setAwardsSyncComplete(String[] ids) {

    String inArray         


        
4条回答
  •  庸人自扰
    2020-12-11 09:14

    I think there is a problem on your update..

    You need to loop your array and update each one by one..

        private int _rowsAffected;
    
        foreach (var a in inArray)
        {
    
        _rowsAffected= db.update(TABLE, contentValues, COL_ID + " = (" + a +")", null);
    
        }
    
        db.Commit();
        db.setTransactionSuccussful(); 
    
    
    if(_rowsAffected > 0)
    //Success
    

    Regards

提交回复
热议问题