0
我在表中插入了兩個字段,即truck_id和employee_id。Android:硬編碼數據的Sqlite插入
對不起提問這個問題。但是,因爲我是Android新手,請幫助我。
public void insert(String[] employeeName,int[] truck_id){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues vals = new ContentValues();
vals.put(COLUMN_TRUCKID, "CM-3456");
vals.put(COLUMN_NAME,"Sachin");
//vals.put(KEY_PIN, "12345");
vals.put(COLUMN_TRUCKID, "HR-6788");
vals.put(COLUMN_NAME,"Sameer");
//vals.put(KEY_PIN, "54321");
vals.put(COLUMN_ID, "AM-6123");
vals.put(COLUMN_NAME,"Sahu");
//vals.put(KEY_PIN, "3452");
db.insert("Login", "John",
vals);
db.insert("Login", "Sameer",
vals);
db.execSQL(COLUMN_NAME);
//myDataBase.close();
}
那麼,什麼是問題? –