我正在从 sqlite 表中删除一行,并且在我做错的地方没有删除行,请建议我。
public void deleteBName(String id)
{
// TODO Auto-generated method stub
SQLiteDatabase db = this.getWritableDatabase();
db.delete(EmergencyTable, colID + "=" + id, null);
}
尝试这个:
//---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 是错误的......