title: SQLite: Table X has no column named Y
body: <p>I've read a lot of threads/questions here about the problem stated above, but no solution seemed to work for me. Here is my database creation:</p>
  
  <pre><code>  public static final String TABLE_CARDS = "cards";
    public static final String COLUMN_ID = "_id";
    public static final String COLUMN_QUESTION = "question";
    public static final String COLUMN_ANSWER = "answer";
  
    private static final String DATABASE_NAME = "cards.db";
    private static final int DATABASE_VERSION = 1;
  
    // Database creation sql statement
    private static final String DATABASE_CREATE = "create table "
        + TABLE_CARDS + "(" 
        + COLUMN_ID + " integer primary key autoincrement, " 
        + COLUMN_QUESTION + " text not null, " 
        + COLUMN_ANSWER + " text not null);";
  </code></pre>
  
  <p>Here I pass a new object to the database:</p>
  
  <pre><code> public Card createCard(String question, String answer) {
      ContentValues values = new ContentValues();
      values.put(MySQLiteHelper.COLUMN_QUESTION, question);
      values.put(MySQLiteHelper.COLUMN_ANSWER, answer);
  
      long insertId = database.insert(MySQLiteHelper.TABLE_CARDS, null,
          values); 
  
      Cursor cursor = database.query(MySQLiteHelper.TABLE_CARDS,
          allColumns, MySQLiteHelper.COLUMN_ID + " = " + insertId, null,
          null, null, null);
      cursor.moveToFirst();
  
  
      Card newCard = cursorToCard(cursor);
      cursor.close();
      return newCard;
    }
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>The error message:</p>
  
  <pre><code>10-12 07:07:55.503: E/SQLiteDatabase(796): Error inserting answer=testanw question=testqu
  10-12 07:07:55.503: E/SQLiteDatabase(796): android.database.sqlite.SQLiteException: table cards has no column named answer (code 1): , while compiling: INSERT INTO cards(answer,question) VALUES (?,?)
  10-12 07:07:55.503: E/SQLiteDatabase(796):  at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
  10-12 07:07:55.503: E/SQLiteDatabase(796):  at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
  10-12 07:07:55.503: E/SQLiteDatabase(796):  at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)
  10-12 07:07:55.503: E/SQLiteDatabase(796):  at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
  10-12 07:07:55.503: E/SQLiteDatabase(796):  at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:58)
  10-12 07:07:55.503: E/SQLiteDatabase(796):  at android.database.sqlite.SQLiteStatement.&lt;init&gt;(SQLiteStatement.java:31)
  10-12 07:07:55.503: E/SQLiteDatabase(796):  at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1467)
  </code></pre>
  
  <p>And the problem is that as soon as i want to write into the database it throws this error. I want to store a String named question and answer in my cards-database. Sorry for missing these informations!!</p>