首页 > SQLite 插入列失败

SQLite 插入列失败

小弟Android初学者,做一个练习的时候遇到小问题,求解答,谢谢!

问题:TIME = time这个列的添加时,为什么失败了?

代码如下:

报错如下:提示“table notes has no column named time”

11-12 11:43:16.647 24230-24230/com.xuchangju.hellonotes2 E/SQLiteLog: (1) table notes has no column named time
11-12 11:43:16.667 24230-24230/com.xuchangju.hellonotes2 E/SQLiteDatabase: Error inserting content=Hello time=2015年11月12日 11:43:16
11-12 11:43:16.667 24230-24230/com.xuchangju.hellonotes2 E/SQLiteDatabase: android.database.sqlite.SQLiteException: table notes has no column named time (code 1): , while compiling: INSERT INTO notes(content,time) VALUES (?,?)

万分感谢!


你是不是没有time这个字段?


你是不是之前测试时,create了notes表,没有卸装。之后改了代码加入time字段,又create一次表?
create了notes表之后,就不会再调用onCreate()了
先卸装久版本,再安装

【热门文章】
【热门文章】