开发者

Android SQlite database table, adding column

开发者 https://www.devze.com 2023-04-05 00:35 出处:网络
I\'m trying to add a column to my database table which was created a while back and every time i try t开发者_高级运维o run the app with the new column in the database adapter it crashes.

I'm trying to add a column to my database table which was created a while back and every time i try t开发者_高级运维o run the app with the new column in the database adapter it crashes.

Why is this happening? I have changed the name of the database so it acts like a fresh table but this still doesn't work..

Please help????


If you are using a subclass of SQLiteOpenHelper as a lot of the Android examples suggest, you need to increment the DB_VERSION int that gets passed to the constructor. Otherwise the onUpgrade method doesn't get called and your db schema doesn't change.

0

精彩评论

暂无评论...
验证码 换一张
取 消