Hi There,
I am trying to connect to a remote MS DB but nothing shows on the emulator.
I have followed the tutorial and when I type in internet explorer:
http://www.dotnet4site.com/mattrack/MyTestPage.aspx?query=Select Description,DateRaised from tbmattrack
I get data back.
But when I try from the android program nothing comes back.
This is my code:
'Activity module
Sub Process_Globals
Dim ServerUrl As String
ServerUrl = "http://www.dotnet4site.com/mattrack/MyTestPage.aspx"
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
HttpUtils.CallbackActivity = "Main"
HttpUtils.CallbackJobDoneSub = "JobDone"
End If
HttpUtils.PostString("Job1", ServerUrl, "SELECT Description, DateRaised FROM tbMatTrack")
End Sub
Sub Activity_Resume
If HttpUtils.Complete = True Then JobDone(HttpUtils.Job)
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub JobDone (Job As String)
If HttpUtils.IsSuccess(ServerUrl) Then
Dim parser As JSONParser
Dim response As String
response = HttpUtils.GetString(ServerUrl)
parser.Initialize(response)
Dim rows As List
rows = parser.NextArray
'work with result
'rows is a List. Each item is a Map with the columns names as keys and the db values as the values.
For i = 0 To rows.Size - 1
Log("Rows #" & i)
Dim m As Map
m = rows.Get(i)
Log("Description=" & m.Get("Description")) 'log the values of col1 and col2
Log("DateRaised=" & m.Get("DateRaised"))
Next
End If
HttpUtils.Complete = False
End Sub
Thanks for your help.
Best Regards,
Steve.
I am trying to connect to a remote MS DB but nothing shows on the emulator.
I have followed the tutorial and when I type in internet explorer:
http://www.dotnet4site.com/mattrack/MyTestPage.aspx?query=Select Description,DateRaised from tbmattrack
I get data back.
But when I try from the android program nothing comes back.
This is my code:
'Activity module
Sub Process_Globals
Dim ServerUrl As String
ServerUrl = "http://www.dotnet4site.com/mattrack/MyTestPage.aspx"
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
HttpUtils.CallbackActivity = "Main"
HttpUtils.CallbackJobDoneSub = "JobDone"
End If
HttpUtils.PostString("Job1", ServerUrl, "SELECT Description, DateRaised FROM tbMatTrack")
End Sub
Sub Activity_Resume
If HttpUtils.Complete = True Then JobDone(HttpUtils.Job)
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub JobDone (Job As String)
If HttpUtils.IsSuccess(ServerUrl) Then
Dim parser As JSONParser
Dim response As String
response = HttpUtils.GetString(ServerUrl)
parser.Initialize(response)
Dim rows As List
rows = parser.NextArray
'work with result
'rows is a List. Each item is a Map with the columns names as keys and the db values as the values.
For i = 0 To rows.Size - 1
Log("Rows #" & i)
Dim m As Map
m = rows.Get(i)
Log("Description=" & m.Get("Description")) 'log the values of col1 and col2
Log("DateRaised=" & m.Get("DateRaised"))
Next
End If
HttpUtils.Complete = False
End Sub
Thanks for your help.
Best Regards,
Steve.