how can i convert this code use results set
this is what i was trying but has errors
B4X:
Dim bitmaps As List = Array("images2.jpg","images2.jpg")
'smiley = LoadBitmapResize(File.DirAssets, "smiley.png", 24dip, 24dip, False)
cursor1 = Starter.SQL1.ExecQuery("SELECT anounce FROM anouncements")
If cursor1.RowCount > 0 Then
For i = 0 To cursor1.RowCount-1
cursor1.Position = i
Dim Phoneg As String
Phoneg =cursor1.Getstring("anounce")
'Log(Phoneg)
If Phoneg=Null Then
Return
End If
Log(i)
Dim content As String = Phoneg
Log(content)
CLV1.Add(CreateItem(CLV1.AsView.Width, $"Anouncement #${i}"$, bitmaps.Get(0), content), "")
Next
End If
this is what i was trying but has errors
B4X:
Dim rs As ResultSet = B4XPages.MainPage.SQL.ExecQuery("SELECT anounce FROM anouncements")
Do While rs.NextRow
Dim row(6) As Object
If cursor1.RowCount > 0 Then
For i = 0 To cursor1.RowCount-1
cursor1.Position = i
row(0) = rs.GetString("anounce")
Dim Phoneg As String
Phoneg =rs.Getstring("anounce")
data.Add(row)
If row(0)=Null Then
Return
End If
Dim content As String = Phoneg
Log(content)
CLV1.Add(CreateItem(CLV1.AsView.Width, $"Anouncement #${i}"$, bitmaps.Get(0), content), "")
Loop
rs.Close
Last edited: