SQLite返回错误代码1 =无列

时间:2012-03-23 11:34:27

标签: android

我试图在我的数据库中插入名为KEY_DAY的新数据,但是当它显示错误

1 个答案:

答案 0 :(得分:2)

您忘记在create table语句中添加列:

 db.execSQL("CREATE TABLE " + DATABASE_TABLE + " (" +
        KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
        KEY_NAME + " TEXT NOT NULL, " +
        KEY_DAY + " TEXT NOT NULL, " +
        KEY_HOTNESS + " TEXT NOT NULL);"
        );