How to delete a specific row in sqlite databse in android? -
i have used separate class creation of db. in have written delete function this
public void name_delete(string name){ sqlitedatabase db = this.getwritabledatabase(); db.delete(table_name, key_name + "=" + name, null); //key_name column name }
in main class called function
db.name_delete(""+all_names.getselecteditem().tostring());
all_names.getselecteditem().tostring() spinner selected item. delete particular row name selected in spinner. me how write function.
should
db.delete(table_name, key_name + "=?", new string[]{name});
also
db.name_delete(all_names.getselecteditem().tostring());
Comments
Post a Comment