我tryed这一点:如何更新特定行中的SQLite数据库?
public void updateCharacter(String charName, int level, int stamina)
{
ContentValues args = new ContentValues();
//args.put(KEY_CHAR_NAME, charName);
args.put(KEY_LEVEL, level);
args.put(KEY_STAMINA, stamina);
db.update(CHARACTERS_TABLE, args, KEY_CHAR_NAME + "=" + charName, null);
}
这是我的FUNC电话:
db.updateCharacter("myPlayer", 2, 2);
获取此异常:
android.database.sqlite.SQLiteException: no such column: myPlayer: , while compiling: UPDATE characters_table SET level=?, stamina=? WHERE charName=myPlayer
进出口99%肯定,我有这样一个专栏中,我可以打印出来,我看到它在一个布局中,在第一列KEY_CHAR_NAME(charName)中定义了myPlayer,所以出了什么问题?
作品,谢谢。! – 2012-08-17 06:37:47