Hi
I have a very simple app that load some data from one MSSQL database using JRDC2.
But I have a problem I don't understand why happening.
B4XTable not show any record. The application run without error Log full of records but nothing on B4XTable.
Need to tell also that I don't get any error and req.PrintTable(res) show my records on log correct.
The code I use is
Any help?
Thank you.
I have a very simple app that load some data from one MSSQL database using JRDC2.
But I have a problem I don't understand why happening.
B4XTable not show any record. The application run without error Log full of records but nothing on B4XTable.
Need to tell also that I don't get any error and req.PrintTable(res) show my records on log correct.
The code I use is
B4X:
Sub GetRecord (info As Map)
Dim Data As List
Data.Initialize
Dim req As DBRequestManager = CreateRequest
Dim cmd As DBCommand = CreateCommand("Select_Recs", Array(info.Get("FromDate"), info.Get("ToDate")))
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 Each row() As Object In res.Rows
DateTime.DateFormat = "yyyy-MM-dd"
DateTime.TimeFormat = "HH:mm:ss"
Dim Dm2, Dm6 As String
Dm2 = DateTime.Date(row(2)) & " " & DateTime.Time(row(2))
Dm6 = DateTime.Date(row(6)) & " " & DateTime.Time(row(6))
Data.Add(Array As Object(row(13), Dm2, row(1), Dm2, row(3), row(4), row(5), Dm6, row(7), row(8), row(9), row(10), row(11), row(12), row(14), row(15)))
Next
Log("========= Size: " & Data.Size) ----> Return ========= Size: 80
req.PrintTable(res)
Else
Log("ERROR: " & j.ErrorMessage)
End If
j.Release
B4XTable1.SetData(Data)
End Sub
Any help?
Thank you.