开发者社区 问答 正文

SQLite 插入列失败

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

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

代码如下:screenshot报错如下:提示“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.SQLiteExcept

展开
收起
a123456678 2016-07-01 15:36:16 2732 分享 版权
1 条回答
写回答
取消 提交回答
  • 你是不是之前测试时,create了notes表,没有卸装。之后改了代码加入time字段,又create一次表?
    create了notes表之后,就不会再调用onCreate()了
    先卸装久版本,再安装

    2019-07-17 19:50:08
    赞同 展开评论
问答分类:
问答标签:
问答地址: