I have the following code that populates a ListView.
However, I am only getting the first record in the table.
How can I count the number of records in the table and loop through the records to populate the ListView with all records?
I cannot use DBUtils.ExecuteListView (as commented out) as I must insert the text "Set Point" as a prefix to MySetPoint.
B4X:
Dim MyZone As String
Dim MySetPoint As String
Dim MyRecords As Int
Dim m As Map
m = DBUtils.ExecuteMap(SQL, "SELECT Id, Zone, SetPoint FROM Zones WHERE id = ?", _
Array As String(Value))
lblViewSelectedTool.Text = Value
lblViewSelectedTool.Visible = True
MyZone = m.Get("zone")'
MySetPoint = m.Get("setpoint")
'Msgbox(MyZone & " " & MySetPoint,"Gotcha")
'DBUtils.ExecuteListView(SQL, "SELECT zone, setpoint FROM Zones WHERE id = ?", Array As String(Value), 0, lstViewZones,True)
lstViewZones.AddTwoLines(MyZone, "Set Point: " & MySetPoint)
However, I am only getting the first record in the table.
How can I count the number of records in the table and loop through the records to populate the ListView with all records?
I cannot use DBUtils.ExecuteListView (as commented out) as I must insert the text "Set Point" as a prefix to MySetPoint.