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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -