开发者

sqlite error querying Android

开发者 https://www.devze.com 2023-03-20 08:42 出处:网络
I\'m trying to recover from my database the list of songs downloaded with开发者_如何学编程 my program.

I'm trying to recover from my database the list of songs downloaded with开发者_如何学编程 my program.

Cursor c = mDb.query(DB_TABLE_SONGS, null, KEY_SONG_DOWNLOADED+" = true", null, null, null, null);

And I receive that error

android.database.sqlite.SQLiteException: no such column: true: 

while compiling:

SELECT * FROM songs WHERE downloaded = true  


Your are missing '' for comparing to a string type column.Try this

Cursor c = mDb.query(DB_TABLE_SONGS, null, KEY_SONG_DOWNLOADED+" = 'true'", null, null, null, null);
0

精彩评论

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