从sqlite表中删除一行

时间:2013-08-31 10:41:54

标签: java android sqlite

我正在从sqlite表中删除一行,而行在我做错的地方没有删除 请建议我。

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

2 个答案:

答案 0 :(得分:0)

试试这个:

 //---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);
    }

答案 1 :(得分:0)

也许您的EmergencyTable或colID错误....