android.database.sqlite.SQLiteException: table contacts has no column named uid -
this code :
public void oncreate(sqlitedatabase db) { string create_contacts_table = "create table if not exists" + table_contacts + "(" + key_id + " integer primary key," // , auto increment handled primary key + key_uid + " text," + key_name + " text," + key_ph_no + " text," + key_comapny + " text," + key_email + " text," + key_country + " text," + key_street + " text," + key_city + " text,"+ key_state + " text," + key_zip + " text);"; db.execsql(create_contacts_table); }
i getting below exception :
: e/sqlitedatabase(2645): android.database.sqlite.sqliteexception: table contacts has no column named uid (code 1): , while compiling: insert contacts(uid,zip,phone_number,email,company_name,street,name,state,city,country) values (?,?,?,?,?,?,?,?,?,?)
please help. thanks
there's syntax error in create table
has not been run. need space between exists
, table name.
since oncreate()
current sql has not been run, have older version of database file around. uninstall app remove , make oncreate()
run again. see when sqliteopenhelper oncreate() / onupgrade() run? more.
Comments
Post a Comment