【发布时间】:2010-02-15 15:57:46
【问题描述】:
更新:见自我回答,“已修复,需要更改 where 子句”
我已经设置了一个内容提供者,出于某种原因,我可以通过这种方式删除一行:
getContentResolver().delete(myUri, "_id=" + "3", null);
但我无法以这种方式删除一行:
getContentResolver().delete(myUri, "NAME=" + "chris", null);
收到此错误:
02-15 15:48:08.197: ERROR/AndroidRuntime(3043): android.database.sqlite.SQLiteException: no such column: chris: , while compiling: DELETE FROM User WHERE NAME=chris
我检查了我的数据库文件,它在那里.. 但由于某种原因,我只能通过 _id 列从我的数据库中删除列,
我该如何解决这个问题?
错误:
02-15 15:48:08.197: ERROR/AndroidRuntime(3043): android.database.sqlite.SQLiteException: no such column: idanmoshik1: , while compiling: DELETE FROM User WHERE USER_NAME=idanmoshik1
*User 是我的表名。
谢谢,
莫希克
【问题讨论】: