'i used this query to test, it is the one from DBUtils demo from erel
Dim m As Map
m.Initialize
m.Put(4,"checkbox")
DBUtils.ExecuteTableView3(SQL1, "SELECT Id, [First Name], [Last Name], Birthday, 0 checkbox FROM Students", Null, 0, TableView1,m)
Public Sub ExecuteTableView3(SQL As SQL, Query As String, StringArgs() As String, Limit As Int, _
TableView1 As TableView,instructions As Map)
TableView1.Items.Clear
Dim cur As ResultSet
If StringArgs = Null Then
Dim StringArgs(0) As String
End If
cur = SQL.ExecQuery2(Query, StringArgs)
Dim cols As List
cols.Initialize
For i = 0 To cur.ColumnCount - 1
cols.Add(cur.GetColumnName(i))
Next
TableView1.SetColumns(cols)
Do While cur.NextRow
Dim values(cur.ColumnCount) As Object
For col = 0 To cur.ColumnCount - 1
If instructions.ContainsKey(col) Then
Dim instruction As String = instructions.Get(col)
Select instruction.ToLowerCase
Case "checkbox"
Dim cb As CheckBox
cb.Initialize("twcb")
If IsNumber(cur.GetString2(col)) Then
cb.Checked = cur.GetInt2(col) <> 0
Else
cb.Text = cur.GetString2(col)
End If
values(col) = cb
End Select
Else
values(col) = cur.GetString2(col)
End If
Next
TableView1.Items.Add(values)
If Limit > 0 And TableView1.Items.Size >= Limit Then Exit
Loop
cur.Close
End Sub