0

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

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

2 回答 2

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);
    }
于 2013-08-31T10:45:44.133 回答
0

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

于 2013-08-31T10:46:07.273 回答