i was write the method to delete row….but, i don’t know why, i can’t delete row….
this is my the method…
public void clearDatabase() {
openDataBase();
try {
int id=0;
Cursor c = myDB.rawQuery("Select id from " + tablename +" asc", null);
if (c.getCount() > 22) {
c.moveToFirst();
id = c.getInt(0);
for(int i = 0;i<11;i++){
int x = id+i;
myDB.execSQL("delete from "+tablename +" where id = "+x , null);
}
}
else
c.close();
closedb();
} catch (SQLiteException ex) {
ex.printStackTrace();
}
}
and this is the logcat:
12-13 12:10:57.073: ERROR/AndroidRuntime(327): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.parser/com.parser.parse}: java.lang.IllegalArgumentException: Empty bindArgs
Please help me!…Thanks before1
I use
in my SQLite DB to delete a row, where lRow is passed from my view activity.
EDIT
and here is my delete button in the view activity
etSQLvRec is a TextView that displays the _id of the record I’m viewing, I pass it so it deletes the record I’m viewing.