android - Getting data from SQLite database error -


i'm getting error frustrating... want title out of database calling this:

    public cursor gettitle(long rowid) throws sqlexception {     cursor mcursor =             db.query(true, database_table, new string[] {                     key_rowid,                     key_datum,                     key_hour,                     key_note             },                     key_rowid + "=" + rowid,                     null,                     null,                     null,                     null,                     null);     if (mcursor != null) {         mcursor.movetofirst();     }     return mcursor; } 

after want retrieve string code:

cursor c = db.gettitle(i);  system.out.println(c.getstring(c.getcolumnindex("hour"))); 

the value between 1 , 8. when call error requested index 0, i'm trying index 2 (which "hour").

thanks in advance!

i tried items out of database deleted earlier. requested item id 1, didn't existed anymore. solved getting data of database.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -