db2.execSQL("Create Table StudentElective1(studentid text UNIQUE,
elective1 text ,elective2 text ,year text)");
if ((db2.insert("StudentElective1", null, values))!=-1) {
Toast.makeText(eigth.this, "Elective Successfully Selected", 2000).show();
} else {
Toast.makeText(eigth.this,
"Insert Error,Elective already selected", 2000).show();
}
如何在插入查詢中指定where條件?在android中的sqlite插入查詢
如何使用更新而不是插入?請說一些例子..剛接觸到android – Suji 2012-03-24 08:44:15
@Suji我修改了我的回答,給出了Android中的update子句的例子 – 2012-03-24 12:32:39