Good evening,
I am a little bit confused with the ResultSet.NextRow method.
I am converting an APP to B4J. I have a Buttonarray on the one
hand, and the result of a databasequery on the other. In the
result I have the information which database entry fits to
which button. Working B4A Example (shortened):
Now in B4J you do not have a cursor, only the resultset. If I try something like this:
The resultset loops through ones for x = 0 . And thats it.
Regards
h725
I am a little bit confused with the ResultSet.NextRow method.
I am converting an APP to B4J. I have a Buttonarray on the one
hand, and the result of a databasequery on the other. In the
result I have the information which database entry fits to
which button. Working B4A Example (shortened):
Example1:
Sub LoadButtons
For x = 0 To (maxX * maxY) - 1
Dim colx As Int = Round2(((b.left / (pnl.Width / maxX)) + 1),0)
Dim rowy As Int = Round2(((b.top / (pnl.Height / maxY)) + 1),0)
For i = 0 To cursor.RowCount - 1
If colx = cursor.GetInt("colx") And rowy = cursorproducts.GetInt("rowy") Then
b.tag = cursor.Getint("id")
b.text = cursor.Getstring("name")
End If
Next
End Sub
Now in B4J you do not have a cursor, only the resultset. If I try something like this:
Example2:
Sub LoadButtons
For x = 0 To (maxX * maxY) - 1
Dim colx As Int = Round2(((b.left / (pnl.Width / maxX)) + 1),0)
Dim rowy As Int = Round2(((b.top / (pnl.Height / maxY)) + 1),0)
Do While resultset.nextrow
If colx = resultset.GetInt("colx") And rowy = resultset.GetInt("rowy") Then
b.Tag = resultset.GetInt("id")
b.Text = resultset.GetString("name")
End If
Loop
Next
The resultset loops through ones for x = 0 . And thats it.
Regards
h725
Last edited: