SQLite: Cannot bind argument at index 1 because the index is out of range. The statement has 0 parameters

后端 未结 2 1234
闹比i
闹比i 2020-12-24 10:18

I\'m getting the following error, and I have no idea why it is occurring. I was wondering if anyone else might be able to shed some light on the issue.

12-2         


        
2条回答
  •  悲&欢浪女
    2020-12-24 11:03

    The selection should be an expression and selectionArgs should have as many elements as there are ? literal placeholders in selection.

    Your selection is not an expression and does not have any ? but you have one element in selectionArgs.

    You probably want something like:

    String selection =  PlayerEntry.COLUMN_NAME_PLAYER_NAME + "=?";
    

    to make it an expression that matches the player name column agains the literal you're binding in selectionArgs[0].

提交回复
热议问题