android - SQLite - Column not creating -


i have read previous posts on , none have provided working solution (restarting emulator, commas, spacing tweaks).

creating simple sqlite database, receiving same error each time run it;

05-12 04:06:17.541    2063-2063/com.disclosure_scots.disclosure_scots e/sqlitelog﹕ (1) table login has no column named tel_no 05-12 04:06:17.542    2063-2063/com.disclosure_scots.disclosure_scots e/sqlitedatabase﹕ error inserting email=test@email.com name=test name tel_no=1231234123 created_at=2015-05-12 06:06:19 uid=55517c3b97a8b8.60336236     android.database.sqlite.sqliteexception: table login has no column named tel_no (code 1): , while compiling: insert login(email,name,tel_no,created_at,uid) values (?,?,?,?,?)             @ android.database.sqlite.sqliteconnection.nativepreparestatement(native method)             @ android.database.sqlite.sqliteconnection.acquirepreparedstatement(sqliteconnection.java:889)             @ android.database.sqlite.sqliteconnection.prepare(sqliteconnection.java:500)             @ android.database.sqlite.sqlitesession.prepare(sqlitesession.java:588)             @ android.database.sqlite.sqliteprogram.<init>(sqliteprogram.java:58)             @ android.database.sqlite.sqlitestatement.<init>(sqlitestatement.java:31)             @ android.database.sqlite.sqlitedatabase.insertwithonconflict(sqlitedatabase.java:1469)             @ android.database.sqlite.sqlitedatabase.insert(sqlitedatabase.java:1341)             @ com.disclosure_scots.disclosure_scots.sqlitehandler.adduser(sqlitehandler.java:85)             @ com.disclosure_scots.disclosure_scots.registeractivity$2.onresponse(registeractivity.java:151)             @ com.disclosure_scots.disclosure_scots.registeractivity$2.onresponse(registeractivity.java:128)             @ com.android.volley.toolbox.stringrequest.deliverresponse(stringrequest.java:60)             @ com.android.volley.toolbox.stringrequest.deliverresponse(stringrequest.java:30)             @ com.android.volley.executordelivery$responsedeliveryrunnable.run(executordelivery.java:99)             @ android.os.handler.handlecallback(handler.java:739)             @ android.os.handler.dispatchmessage(handler.java:95)             @ android.os.looper.loop(looper.java:135)             @ android.app.activitythread.main(activitythread.java:5257)             @ java.lang.reflect.method.invoke(native method)             @ java.lang.reflect.method.invoke(method.java:372)             @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:903)             @ com.android.internal.os.zygoteinit.main(zygoteinit.java:698) 

my code, have tried different spacing no avail;

// login table columns names     private static final string key_id = "id";     private static final string key_name = "name";     private static final string key_email = "email";     private static final string key_uid = "uid";     private static final string key_created_at = "created_at";     private static final string key_tel_no = "tel_no";      public sqlitehandler(context context) {         super(context, database_name, null, database_version);     }      // creating tables     @override     public void oncreate(sqlitedatabase db) {         string create_login_table = "create table " + table_login + "("                 + key_id + " integer primary key, "                 + key_name + " text, "                 + key_email + " text unique, "                 + key_uid + " text, "                 + key_created_at + " text, "                 + key_tel_no + " text " + ")";         db.execsql(create_login_table);          log.d(tag, "database tables created");     }      // upgrading database     @override     public void onupgrade(sqlitedatabase db, int oldversion, int newversion) {         // drop older table if existed         db.execsql("drop table if exists " + table_login);          // create tables again         oncreate(db);     } 

am missing obvious?

right, despite restarting emulator appears second app had running in android studio window, using same db name, booting each time ran main app.

thanks answering guys, sorry waste time.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -