Android Question Results information from the JRDC2 consult in B4A

manuelsalazar

Member
Licensed User
I have the results information from the JRDC2 consult in B4A, is there any simple command to send it to a ListView/Webview/CustomView object ?????


Thanks in advanced.
Manuel
 

Johan Hormaza

Well-Known Member
Licensed User
B4X:
    Dim req As DBRequestManager = CreateRequest
    Dim cmd As DBCommand = CreateCommand("Select_dataBase_SQL",Array())
    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)
        For a = 0 To res.Rows.Size - 1
            Dim fila() As Object = res.Rows.Get(a)
            Dim p As B4XView = xui.CreatePanel("")
            Dim height As Int = 140dip
            If GetDeviceLayoutValues.ApproximateScreenSize < 4.5 Then height = 110dip
            p.SetLayoutAnimated(0, 0, 0, CLVSubMenu.AsView.Width, height)
            p.LoadLayout("CardSubmenu")
            lblTituloSub.Text = fila(res.Columns.GetValueAt(1))
            lblDetalles1.Text = fila(res.Columns.GetValueAt(2))
            imgSubM.Bitmap =  CreateRequest.BytesToImage(fila(res.Columns.GetValueAt(0))).Resize(imgSubM.Width,imgSubM.Height,True)
            CLVSubMenu.Add(p,fila(res.Columns.GetValueAt(1)))
        Next
    End If
    j.Release
B4X:
Sub CreateRequest As DBRequestManager
   Dim req As DBRequestManager
   req.Initialize(Me,rdcLink)
   Return req
End Sub

Sub CreateCommand(Name As String, Parameters() As Object) As DBCommand
   Dim cmd As DBCommand
   cmd.Initialize
   cmd.Name = Name
   If Parameters <> Null Then cmd.Parameters = Parameters
   Return cmd
End Sub
 
Top