你好,任何幫助將是偉大的謝謝你! 我有3場在我的數據庫表返回整數數組的SQLite查詢數據
public static final String colExpID = "ExpenseID";
public static final String colExpExpense = "ExpenseDisc";
public static final String colExpAmount = "Amount";
我的方法來查詢數據
public Integer[] queryHouse() {
// TODO Auto-generated method stub
String[] columns = new String[]{colExpID,colExpExpense,colExpAmount};
Integer[] Result = new Integer[]{};
Cursor c = ourDatabase.query(ExpenseTable, columns, null, null, null, null, null);
int iExpense = c.getColumnIndex(colExpExpense);
int iAmount = c.getColumnIndex(colExpAmount);
for(int i = 0; i < c.getCount();i++){
if(c.getString(iExpense) == "House"){
Result[i] = Integer.parseInt(c.getString(iAmount));
}
}
return Result;
}
我不知道我錯過了什麼謝謝!
我也不清楚,你錯過了什麼,因爲你沒有指定什麼是你所要完成的,你是如何在不及格的。 – SWeko 2012-03-18 10:04:23