samedi 14 février 2015

Cursor in Android not Returning Rows/Data

Im new at android programming. can you help me fetch rows using cursor.


with this code i can fetch all the rows :



public Cursor getAllDataDays() {
SQLiteDatabase db = this.getWritableDatabase();
String selectQuery = "SELECT * FROM " + TABLE_MYBUDGETWITHDAYS;
return db.rawQuery(selectQuery, null);
}


this is my code for fetching specific rows:



public Cursor SelectAllDaysIntParent(int id) {
SQLiteDatabase db = this.getWritableDatabase();
String selectQuery = "SELECT * FROM " + TABLE_MYBUDGETWITHDAYS + " WHERE" + KEY_PARENTID + " = " + id;
return db.rawQuery(selectQuery, null);

}


but is not displaying any rows.


please help. thank you.


NOTE: i want a method with Cursor in it because my listview custome adapter requires cursor.


Aucun commentaire:

Enregistrer un commentaire