Please what am i doing wrong in this code.
Am getting error message that "JSON array expected". The error occurs in jobdone.
I was expecting that once the application get to the Jobdone i was expecting the data to be in Mysql database but there's nothing in there
Am getting error message that "JSON array expected". The error occurs in jobdone.
I was expecting that once the application get to the Jobdone i was expecting the data to be in Mysql database but there's nothing in there
B4X:
Dim iMap As Map
iMap.Initialize
Dim JSONList As List
JSONList.Initialize
sel=SQL1.ExecQuery("SELECT * FROM DB_TransactionsDaily WHERE AgentID='" & LogIn_MobilizerID & "' AND Upload='" & Upload & "'")
sel.Position=0
recNo=sel.RowCount
ProgressDialogShow2("Exporting Deposit Transactions from Phone to server. Please Wait...",False)
If sel.RowCount>0 Then
For i = 0 To sel.RowCount-1
sel.Position=i
iMap.put("AgentID", sel.GetString("AgentID"))
iMap.put("Cr", sel.GetString("Cr"))
iMap.put("Inputer", sel.GetString("Inputer"))
iMap.put("MemberID", sel.GetString("MemberID"))
iMap.put("ProID", sel.GetString("ProID"))
iMap.put("TransDetails", sel.GetString("TransDetails"))
iMap.put("AutoID", sel.GetString("AutoID"))
Next
JSONList.add(iMap)
sel.Close
Dim JSONGenerator As JSONGenerator
JSONGenerator.Initialize2(JSONList)
Dim JSONstring As String
JSONstring = JSONGenerator.ToString
Try
Dim DownloanTransactions As HttpJob
DownloanTransactions.Initialize("Export Data", Me)
DownloanTransactions.PostString(Server, Array As String ("action","JSONTRANS","MyJSON",JSONstring))
Catch
Msgbox(LastException.Message,"Error")
Log(LastException)
End Try
ProgressDialogHide
End If