Delete row in sqlite database android

public void deletedata(Context ctx,String del,)
    {
        SQLiteDatabase myDB = null;

        try {
            myDB = ctx
                    .openOrCreateDatabase(DB_NAME, Context.MODE_WORLD_WRITEABLE , null);
            String table_name = "dummy"; // dummy is tble name in sqlite database
           

            myDB.delete(table_name," name=?", new String [] {del});
       
                     }



where table_name is ur tablename in database and name is ur coloumn frm where u want to delete rows n del is the parameter to match with name...

Comments

Post a Comment

Popular Posts