Sorry I'am a Newbie.
But simple code give me an error that really can't understand.
I have a simple database with two fields 'plunummer' and 'varetekst' in a table called 'drikkevare' all fields are formatted as text - i'am using Sqllitebrowser to create the database
All works fine when I create records, delete records an so on
But the problem is when I need to find a record based on data in field 'plunummer' and the get the data that is stored in field 'varetekst'
I'am absolutely sure that there are the right data in the table!
Her is my code:
Sub ListViewForDrikkeVarer_ItemClick (Position As Int, Value As Object)
Dim Plu As String
Dim TekstTilPlu As String
dbCursor=dbSQL.ExecQuery2("SELECT varetekst FROM drikkevarer WHERE plunummer = ?", Array As String(Value))
Plu = dbCursor.GetString ("varetekst")
dbCursor.Close
The Error is:
LastException android.database.cursorindexOutOfBoundsException: Index-1 requested, with a size of 1
Pls help
/Thomas
But simple code give me an error that really can't understand.
I have a simple database with two fields 'plunummer' and 'varetekst' in a table called 'drikkevare' all fields are formatted as text - i'am using Sqllitebrowser to create the database
All works fine when I create records, delete records an so on
But the problem is when I need to find a record based on data in field 'plunummer' and the get the data that is stored in field 'varetekst'
I'am absolutely sure that there are the right data in the table!
Her is my code:
Sub ListViewForDrikkeVarer_ItemClick (Position As Int, Value As Object)
Dim Plu As String
Dim TekstTilPlu As String
dbCursor=dbSQL.ExecQuery2("SELECT varetekst FROM drikkevarer WHERE plunummer = ?", Array As String(Value))
Plu = dbCursor.GetString ("varetekst")
dbCursor.Close
The Error is:
LastException android.database.cursorindexOutOfBoundsException: Index-1 requested, with a size of 1
Pls help
/Thomas