CREATE TABLE
private void createSerialDateTable() {
mDatabase.execSQL(
"CREATE TABLE IF NOT EXISTS SerialDate (n" +
" id INTEGER NOT NULL CONSTRAINT SerialDate_pk PRIMARY KEY AUTOINCREMENT,n" +
" name varchar(200) NOT NULL,n" +
" joiningdate datetime NOT NULLn" +
");"
);
}
INSERT TABLE
String insertSQL = "INSERT INTO SerialDate n" +
"(name, joiningdate)n" +
"VALUES n" +
"(?, ? );";
mDatabase.execSQL(insertSQL, new String[]{name, joiningDate});
Delete all items from List I try it But it not working.
clear.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// serialDateList.clear();
Cursor cursorSerialDate = mDatabase.rawQuery("DELETE FROM SerialDate", null);
cursorSerialDate.close();
adapter.notifyDataSetChanged();
}
});
How can I delete all data definitely.
Please. Help me !