Error in database cannot save data in table

Asked

Viewed 88 times

0

to make a video lesson to save data in the database, I’ve done 3 different tutorials always error, follows down the Logcat in info.

05-29 14:02:57.894 22842-22842/com.roma0x.mycash E/Sqlitelog: (1) in such table: added 05-29 14:02:57.896 22842-22842/com.roma0x.mycash E/Sqlitedatabase: Error inserting name=Test android.database.sqlite.Sqliteexception: no such table: added (code 1): while compiling: INSERT INTO added(name) VALUES (?) at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(Sqliteconnection.java:889) at android.database.sqlite.SQLiteConnection.prepare(Sqliteconnection.java:500) at android.database.sqlite.SQLiteSession.prepare(Sqlitesession.java:588) at android.database.sqlite.SQLiteProgram.(Sqliteprogram.java:58) at android.database.sqlite.SQLiteStatement.(Sqlitestatement.java:31) at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(Sqlitedatabase.java:1472) at android.database.sqlite.SQLiteDatabase.Insert(Sqlitedatabase.java:1343) at com.roma0x.mycash.Activity.AionarActivity.onCreate(Adicionaractivity.java:69) at android.app.Activity.performCreate(Activity.java:6760) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119) at android.app.Activitythread.performLaunchActivity(Activitythread.java:2618) at android.app.Activitythread.handleLaunchActivity(Activitythread.java:2726) at android.app.Activitythread. -wrap12(Activitythread.java) at android.app.Activitythread$H.handleMessage(Activitythread.java:1477) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:159) at android.app.Activitythread.main(Activitythread.java:6139) at java.lang.reflect.Method.invoke(Native Method) at com.android.Internal.os.Zygoteinit$Methodandargscaller.run(Zygoteinit.java:886) at com.android.Internal.os.Zygoteinit.main(Zygoteinit.java:776)

1 answer

1

The problem is that the system is not finding the table added

"Ah! but I put this table yes, it is there!"

Okay, so you have two options to solve,

First:

Go up the version of your local bank, if it is in version 1, go up to 2, if it is in 2, go up to 3 and so on

Second:

Uninstall the device application before re-compiling, doing this the current database will be removed, and when vc compile will be installed only the new one, ignoring the old one.

I hope I’ve helped!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.