我的插入语句:dbexecSQLinsert into dict valuesnull new Stringword detail;我的建表语句:public static final String CREATE_TABLE_SQL = create table dict_id integer primary + key autoincrement word de
根据您提供的信息,报错是因为您的建表语句中只定义了两个列(word和detail),但您的插入语句中却提供了三个值(null、word和detail)。
为了解决这个问题,您需要修改建表语句,为_id列添加一个名称和数据类型,例如使用integer类型:
public static final String CREATE_TABLE_SQL = "create table dict(_id integer primary key autoincrement, word text, detail text)";
然后您的插入语句就可以正常执行了。
原文地址: http://www.cveoy.top/t/topic/jaLO 著作权归作者所有。请勿转载和采集!