Skip to content Skip to sidebar Skip to footer

Deleting From Sqlite

Hy! I always get e sql error. I log the id of the choosen item and then i want to remove it from the ListView and from the db My code: public boolean onItemLongClick(final AdapterV

Solution 1:

Preferred way to delete from SQLLite DB is with db.delete() Something like: db.delete(DBAdapter.TableName, "Id=?", new String[] { pizza.id });

Solution 2:

You sure your pizza ID column named "ID"? android sqlite database already has a column nameed "_id" as the ID field.

Solution 3:

android.database.sqlite.SQLiteException: no such column: ID: DELETEFROM Pizza WHERE ID=1

Error indicates that there is No Column named ID, so ensure that the Name of Pizza id is ID or something else.

Post a Comment for "Deleting From Sqlite"