0
name = namebox.getText().toString();
db.open();
Cursor c1 = db.executequery("SELECT _id FROM " + DATABASE_TABLE_CUSTOMER + " where name='" +name+"'");
_id = c1.getInt(c1.getColumnIndex("name"));
Cursor c2 = db.executequery("SELECT amount FROM " + DATABASE_TABLE_CUSTOMER
+
" where _id=" + _id);
Double amount = c2.getDouble(c2.getColumnIndex("amount"));
Cursor c3 = db.executequery("SELECT arrear FROM " + DATABASE_TABLE_CUSTOMER + " where CUSTOMER_ID =" + _id);
arrear = c3.getDouble(c3.getColumnIndex("arrear"));
db.close();
這給我一個錯誤的字段錯誤請求。在我的適配器執行查詢的方法如下所示:字段錯誤的錯誤請求
public Cursor executequery(String query) throws SQLException
{
Cursor mCursor = db.rawQuery(query, null);
if(mCursor != null){
mCursor.moveToFirst();
}
return mCursor;
}
任何人都可以告訴我什麼我做錯了。我在這個新的。
你可以發佈logcat嗎? – FoamyGuy