In my application I created a database and I tried to insert values into that table. But I received the following error:
android.database.sqlite.SQLiteException: table income has no column named recurrence: , while compiling: INSERT INTO income(recurrence, salary, description) VALUES(?, ?, ?);
My code is:
Database creation:
"create table income(_id integer primary key autoincrement,"+"salary text not null,description text not null,"+"recurrence text not null);";
My insert query:
public long insertTitle(String income, String desc,String recurr)
{
ContentValues initialValues = new ContentValues();
initialValues.put(KEY_INCOME, income);
initialValues.put(KEY_DESC, desc);
initialValues.put(KEY_RECURR, recurr);
//initialValues.put(KEY_PUBLISHER, publisher);
return db.insert(DATABASE_TABLE, null, initialValues);
}
Try to clear your database form Android device. Maybe you application not overwriting the new database and using the old database. This may be a reason for this error.