udacity / ud845-Pets

Other
240 stars 717 forks source link

E/SQLiteDatabase: Error inserting data #7

Closed chekwon78 closed 7 years ago

chekwon78 commented 7 years ago

The code, as is, runs fine on my emulator. However, when I click 'Insert Dummy Data' it fails to insert the data in the database. The following is the error I get on my logcat:

3-23 16:32:25.059 5771-5771/com.example.android.pets E/SQLiteDatabase: Error inserting name=Toto gender=1 weight=7 breed=Terrier android.database.sqlite.SQLiteException: table pets has no column named gender (code 1): , while compiling: INSERT INTO pets(name,gender,weight,breed) VALUES (?,?,?,?)

Any help would be greatly appreciated

AlShaymaa1 commented 7 years ago

uninstall the app and install it again

Bniky commented 6 years ago

This happen to me and I didn't space out the data types in dbhelper class example. " TEXT NOT NULL, "

himanshuchokker1 commented 6 years ago

i uninstalled my app and re installed it but the problem remains same column has no table error while compiling INSERT INTO ....

vincentyahaha commented 6 years ago

Had the same issue, here is my solution. Clear the cache, and run the app again.