简体   繁体   中英

Delete a row from sqlite table

I am deleting a row from sqlite table and row is not doing delete where i am doing wrong please suggest me.

public void deleteBName(String id) 
    {
// TODO Auto-generated method stub
        SQLiteDatabase db = this.getWritableDatabase(); 
        db.delete(EmergencyTable, colID + "=" + id, null);
    }

try this:

 //---deletes a particular title---
public boolean deleteTitle(String name) 
{
    return db.delete(DATABASE_TABLE, KEY_NAME + "=" + name, null) > 0;
}

--

public void deleteBName(String id) 
    {
// TODO Auto-generated method stub
        SQLiteDatabase db = this.getWritableDatabase(); 
        return db.delete(EmergencyTable, colID + "=" + id, null);
    }

也许您的EmergencyTable或colID错误。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM