且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SQL 表未找到异常

更新时间:2022-11-06 12:57:04

您正在查询 event_db 表,它是您的数据库的名称,而不是您的

You are querying the event_db table which is the name of your database, not your table

Cursor c = db.rawQuery("SELECT * FROM "+ "event_db",null);

你应该查询_table

Cursor c = db.rawQuery("SELECT * FROM "+ "_table",null);

顺便说一句,如果您将数据库命名为 db(我怀疑您无论如何都需要多个 db)和您的表 _event(您可以有许多表,您应该根据它们的角色命名它们,而不仅仅是 _table)

By the way it would be more clear if you name your database db (I doubt you need more than one db anyway) and your table _event (you can have many tables and you should name them accordingly to their role and not just _table)