Sub GetRecord
Dim req As DBRequestManager = CreateRequest
Dim cmd As DBCommand = CreateCommand("czytaj2",Null)
Wait For (req.ExecuteQuery(cmd, 0, Null)) JobDone(j As HttpJob)
If j.Success Then
req.HandleJobAsync(j, "req")
Wait For (req) req_Result(res As DBResult)
If res.Rows.Size > 0 Then
Dim row() As Object = res.Rows.Get(a)
Label1.Text = row(res.Columns.Get("col1"))
Label2.Text = row(res.Columns.Get("col2"))
Label3.Text = row(res.Columns.Get("col3"))
Dim ima As B4XBitmap
ima = BytesToImage(row(res.Columns.Get("image")))
ImageView1.SetImage(ima)
Else
Log("ERROR: " & j.ErrorMessage)
End If
End If
j.Release
End Sub
Public Sub BytesToImage(bytes() As Byte) As B4XBitmap
Dim In As InputStream
In.InitializeFromBytesArray(bytes, 0, bytes.Length)
Dim bmp As Image
bmp.Initialize2(In)
Return bmp
End Sub
Sub Button3_Click
a=a+1
If a =10 Then a=0
GetRecord
End Sub