我error no such table not found
在我的项目中使用了2 个数据库。一个工作正常,但另一个显示错误。
这是我的代码
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();
}