2012-04-24 49 views
2

我收到「綁定值的指數1爲空」在下面的查詢:查詢中索引1的綁定值爲空?

public String searchForWifiSSID(String one, String two){ 
c = db.query(Constants.TABLE_NAME, new String[]{Constants.PARAM1, Constants.PARAM2}, Constants.PARAM1 + " =? " +" AND " + Constants.PARAM2 + " =? ", new String[]{one,two}, null, null, null); 
} 

是我selectionArgs兩個不正確的語法?這是不正確的:

public String searchForWifiSSID(String one, String two){ 
    c = db.query(Constants.TABLE_NAME, new String[]{Constants.PARAM1, Constants.PARAM2}, Constants.PARAM1 + " = " + one +" AND " + Constants.PARAM2 + " = " + two, null, null, null, null); 
    } 

回答

6

確保值「一」和「兩」不是NULL。我相信錯誤意味着其中一個值爲空。

+0

yup!找到空值。謝謝! – benbeel 2012-04-24 15:13:38

相關問題