我想要創建名為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 (?,?,?,?,?,?)
以下是我的代碼:


求助求助!~
uj5u.com熱心網友回復:
沒看到你有創建這個表啊recording_table?uj5u.com熱心網友回復:
1、你注釋掉的sqliteDb.execSQL能不能正確執行。2、你使用的現方法中的表名為:“recording_table”,但是你創建的表的名稱為:mobileTable,你可能想使用變數recording_table來表示mobileTable,這種情況下我要定義了字串變數recording_table,并且給recording_table賦值為“mobileTable”,在insert方法中recording_table不能加雙引號。
uj5u.com熱心網友回復:
你的創建表陳述句有問題,sqlite哪來的String呢……改成text先學習下sqlite的基本語法https://www.runoob.com/sqlite/sqlite-create-table.html
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/123163.html
標籤:Android
上一篇:關于黑蘋果
下一篇:APP呼叫C#寫的webservice操作資料庫(SQLSEERVER2012)的資料,可以增加,更新資料,但洗掉失敗!
