Database Causes App To Crash
I'm trying to make a simple app with a database. The problem is that for some reason the app crashes upon launch. Sadly the crash log doesn't tell me very much except that there se
Solution 1:
You go wrong here
+ KEY_SUM + " TEXT," // remove ,(comma) fromlast
correct:
StringDATABASE_CREATE_SQL="CREATE TABLE " + DATABASE_TABLE
+ " (" + KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ KEY_TRANSACTION + " TEXT NOT NULL, "
+ KEY_ITEM + " TEXT NOT NULL, "
+ KEY_SUM + " TEXT"
+ ");";
Also change transaction column name becoz it's reserved and cannot be used in queries.
Solution 2:
publicstaticfinalStringKEY_TRANSACTION="transaction";
Word transaction is a reserved word in SQL and cannot be used as a column name. Change it to transaction_text or something similar.
Post a Comment for "Database Causes App To Crash"