title: I am trying to make login module in android studio but i got the error as following..(Column name doesn't exist)
body: <pre><code> public class Database extends SQLiteOpenHelper {
          public static final String DATABASE_NAME = "userdetail1";
          public static final String TABLE_NAME = "sample";
          public static final String COLUMN_ID = "id";
          public static final String NAME = "username";
          public static final String PASSWORD = "u_password";
          public static final String table_create = "create table " + TABLE_NAME + "(" + COLUMN_ID + " INTEGER PRIMARY KEY," + NAME + "TEXT," + PASSWORD + "TEXT" + ")";
  
  
      SQLiteDatabase database;
  
      public Database(Context context, Object o, Object o1, int i) {
          super(context, DATABASE_NAME, null, 1);
      }
  
      @Override
      public void onCreate(SQLiteDatabase database) {
          database.execSQL(table_create);
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase database, int i, int i1) {
          database.execSQL("DROP TABLE IF EXISTS contacts");
          onCreate(database);
  
      }
      public static  int flag=0;
      public void add(GetterandSetter gs)
      {
          database=this.getWritableDatabase();
          ContentValues values=new ContentValues();
          values.put(NAME,gs.getUsername());
          values.put(PASSWORD,gs.getPassword());
          database.insert(TABLE_NAME,null,values);
          flag=1;
  
  
          database.close();
      }
  
  }
  </code></pre>
  
  <p>I got the error stating that  android.database.sqlite.SQLiteException: table sample has no column named username (code 1): , while compiling: INSERT INTO sample(username,u_password) VALUES (?,?)</p>