I have a simple method in a WebContainer that should append and embed content containers (productOverviewContainer) to it:
Public Sub ShowProducts(classid as string = "", kindid as string = "")
For Each child As ProductOverviewContainer In content
child.Close
Next
lasty = 0
Redim content(-1)
Dim selection As String = "Select * from products "
If classid <> "-01" Then selection = selection + "where productclass = """ + classid + """"
If kindid <> "" Then selection = selection + " and productkind = """ + kindid + """"
ITDSystem.DebugLog 1, "Selection: " + selection
Dim rs As recordset = Datenbank.db.SQLSelect(selection)
If rs = Nil Then
ITDSystem.DebugLog 1, "RS is nil!"
Else
ITDSystem.DebugLog 1, "Count: " + rs.RecordCount.ToText
ITDSystem.DebugLog 1, Datenbank.db.ErrorMessage
For q As Integer = 1 To rs.RecordCount
Dim cont As New ProductOverviewContainer
cont.Height = 276
cont.Width = Me.Width
content.Append cont
cont.EmbedWithin Me, 0, lasty, Me.Width, 276
cont.LockRight = True
lasty = lasty + 276
rs.MoveNext
ITDSystem.DebugLog 1, "RS movenext"
Next
End If
End Sub
content() is an array of ProductOverviewcontainers.
The recordset returns a valid number of records, there is no db error, but for some reason the last loop is never run. (I used to define it with “While not rs.eof” initially, but the same. Any ideas what I might have overseen?