我想要创建名为mobiletable的表格,并向表里不断添加数据,但是总显示添加失败并报错:
android.database.sqlite.SQLiteException: no such table: recording_table (code 1): , while compiling: INSERT INTO recording_table(Times,All_Memory,THIS_CPU,THIS_Memory,ALL_CPU,Name) VALUES (?,?,?,?,?,?)以下是我的代码:求助求助!~

解决方案 »

  1.   

    没看到你有创建这个表啊recording_table?
      

  2.   

    1、你注释掉的sqliteDb.execSQL能不能正确执行。
    2、你使用的现方法中的表名为:“recording_table”,但是你创建的表的名称为:mobileTable,你可能想使用变量recording_table来表示mobileTable,这种情况下我要定义了字符串变量recording_table,并且给recording_table赋值为“mobileTable”,在insert方法中recording_table不能加双引号。
      

  3.   

    你的创建表语句有问题,sqlite哪来的String呢……改成text
    先学习下sqlite的基本语法https://www.runoob.com/sqlite/sqlite-create-table.html