我得到error no such table not found
在我的項目中我使用了2個數據庫。一個是完美的工作,但另一個顯示錯誤。android錯誤顯示沒有這樣的表
這裏是我的代碼
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
String CREATE_ADDRESS = " CREATE TABLE " + TABLE_ADDRESS + "(" + KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"+ KEY_STATE + " TEXT," + KEY_CITY + " TEXT," + KEY_ZIPCODE + " TEXT," + KEY_STREET + " TEXT," + KEY_DOOR + " TEXT,"+ ");";
try{
db.execSQL(CREATE_ADDRESS);
}catch (SQLException e)
{
e.printStackTrace();
}
}
我試圖用這個代碼
public void addAddress(AddressList address) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(KEY_STATE, address.getState()); values.put(KEY_CITY, address.getCity()); values.put(KEY_ZIPCODE, address.getZipcode()); values.put(KEY_STREET, address.getStreet()); values.put(KEY_DOOR, address.getDoor()); db.insert(TABLE_ADDRESS,null, values); db.close(); }
雅我連同樣的錯誤可能發生 – Siva