CursorIndexOutOfBounds problem

tufanv

Expert
Licensed User
Longtime User
Hello,

I have 3 records in my sql file. When i use cursor1.position = 0 i can get the values from fields of record 1 but when i use cursor1.position = 1 i can not get the values of fields of record 2. it gives outofbounds error. What is the problem with my code any ideas ?

TY
 

tufanv

Expert
Licensed User
Longtime User
I have 3 different products and each of the product have their own specifications under the fields of weight size price and id. when I click on priduct 1 in my app I want ti get the field values of priduct 1 and I can get it when cursor position is 0. But I can not get the values of product 2 and 3 when I click on them. Hope I explained clearly
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
oh. got the problem. the sql file is not updated via application installs because it exists and the file is not overwrittenm. When i uninstall the app and reinstall problem resolved. (the older version had only 1 record and was not updated ) TY !
 
Upvote 0

Wien.Mart

Member
Licensed User
Longtime User
I have the same problem. I query one record and want to populate text boxes with the query result. I issue the same sql on the sqlite using sqlite database browser and it returns one set of records with about thirty fields. qcur=sql1.execquery("select * from table where id = 10") there is no error. when i do lname.text = qcur.getstring("last_name") i get the error "lastexception android.database.cursorindexoutofboundsexception: index-1 requested. with size of 1"

What could i be doing wrong? Please help.
 
Upvote 0
Top