java - No data in cursor -
i´ve got application reads , writes in sqlite-database.
public void insertkind(int id, string name, string geburtsdatum, string geschlecht){ long rowid = 1; try{ sqlitedatabase db = getwritabledatabase(); contentvalues cv = new contentvalues(); cv.put(name, name); cv.put(geburtsdatum, geburtsdatum); cv.put(geschlecht, geschlecht); try{ rowid = db.insert(table_name_kind, null, cv); } catch(exception e){ system.out.println("des derf ma neeeeeeeeeeed seng!!!!"); } db.close(); } catch (sqliteexception e){ log.e(tag, "insert()", e); } finally{ log.d(tag, "rowid"); } }
with following code want select data database:
public cursor select(){ sqlitedatabase db = getreadabledatabase(); cursor cursor = db.query(table_name_kind, new string[] {"_id", "name", "geburtsdatum", "geschlecht"}, "" + "", null, null, null, null); system.out.println(cursor.getcount()); return cursor; }
i used similiar code in different application. problem cursor.getcount()
0, there no exceptions when insert data. name
, geburtsdatum
, geschlecht
have values.
i can´t check database adb because doesn´t work on computer. problem?
if cursor.getcount()
get's 0 query execute on database.
i think problem may in clause , try set null
instead "" + ""
cursor cursor = db.query(table_name_kind, new string[] {"_id", "name", "geburtsdatum", "geschlecht"}, null, null, null, null, null);
Comments
Post a Comment