title: SQLite says no such column
body: <p><strong>DBAdapter.java</strong></p>
  
  <pre><code>public void onCreate(SQLiteDatabase db) {
  
      db.execSQL(" CREATE TABLE " + DATABASE_TABLE + " (" + KEY_FIRSTNAME
                              + " TEXT NOT NULL, " + KEY_MIDDLENAME + " TEXT NOT NULL, "
                              + KEY_LASTNAME + " TEXT NOT NULL, " + KEY_USERNAME
                              + " TEXT NOT NULL, " + KEY_MAIL_ID + " TEXT NOT NULL, "
                              + KEY_PASSWORD + " TEXT NOT NULL, " + KEY_CONFIRM
                              + " TEXT NOT NULL, " + KEY_DATE_OF_BIRTH
                              + " INTEGER NOT NULL " + KEY_COUNTRY + " TEXT NOT NULL "
                              + ");");
  
  }
  
  
  public String getSinlgeEntry(String userName) {
  
      Cursor cursor = mDB.query(DATABASE_TABLE,null,"KEY_USERNAME=?",new String[]{userName},null,null,null);
      if (cursor.getCount() &lt; 1) // UserName Not Exist
          return "NOT EXIST";
      cursor.moveToFirst();
      String password = cursor.getString(cursor.getColumnIndex("KEY_PASSWORD"));
      return password;
  
  }
  </code></pre>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>dbadapter = new DBAdapter(MainActivity.this);
  dbadapter.open();
  String stored_password = dbadapter.getSinlgeEntry(username);
  
  if(password.equals(stored_password))
  {
      Toast.makeText(MainActivity.this,"It is logging in",Toast.LENGTH_SHORT).show();
      Intent intent = new Intent(MainActivity.this,Profile_view.class);
      startActivity(intent);
  
  }
  </code></pre>
  
  <p><strong>Logcat:</strong></p>
  
  <pre><code>12-06 14:52:20.213: E/AndroidRuntime(9431): FATAL EXCEPTION: main
  12-06 14:52:20.213: E/AndroidRuntime(9431): android.database.sqlite.SQLiteException: no such column: KEY_USERNAME: , while compiling: SELECT * FROM Saturday_Table_1129 WHERE KEY_USERNAME=?
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.database.sqlite.SQLiteCompiledSql.&lt;init&gt;(SQLiteCompiledSql.java:64)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.database.sqlite.SQLiteProgram.compileSql(SQLiteProgram.java:147)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.database.sqlite.SQLiteProgram.compileAndbindAllArgs(SQLiteProgram.java:368)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:131)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:95)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:46)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:47)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1534)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1414)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1370)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1450)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at com.example.signup.DBAdapter.getSinlgeEntry(DBAdapter.java:175)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at com.example.signup.MainActivity$1.onClick(MainActivity.java:55)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.view.View.performClick(View.java:3100)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.view.View$PerformClick.run(View.java:11644)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.os.Handler.handleCallback(Handler.java:587)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.os.Handler.dispatchMessage(Handler.java:92)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.os.Looper.loop(Looper.java:126)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at android.app.ActivityThread.main(ActivityThread.java:3997)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at java.lang.reflect.Method.invokeNative(Native Method)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at java.lang.reflect.Method.invoke(Method.java:491)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
  12-06 14:52:20.213: E/AndroidRuntime(9431):     at dalvik.system.NativeStart.main(Native Method)
  12-06 14:52:28.734: I/Process(9431): Sending signal. PID: 9431 SIG: 9
  </code></pre>
  
  <p>I am validating the username and password from the database. When i compile,it says no such column but i have defined the KEY_USERNAME column. The database has the username that I am trying to use for validation but it doesn't work. Help will be much appreciated. </p>