Skip to content Skip to sidebar Skip to footer

Delete Sqlite Database In Android

I have created a database in sqlite named as DGC.DB and table name is drivers and now I want to drop my existing table in sqlite database .I try to delete this by exute delete que

Solution 1:

To Drop a table, use:

Replace

publicvoiddeleteAll() {
    db.delete(TABLE_NAME, null, null);
 }

With

publicvoiddropTable() {
  db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
}

Post a Comment for "Delete Sqlite Database In Android"