DatabaseColumn.Name
From Xojo Documentation
Read-Only Property (As String )
Used to get the name of the column.
Sample Code
The following method populates a ListBox with a RowSet. It uses the Name and StringValue properties to obtain the columnnames and values:
Sub PopulateListBox(dataList As Listbox, rs As RowSet)
If rs Is Nil Then Return
// set up listbox state for population
dataList.RemoveAllRows
// Add the DB columns as the heades for the ListBox
dataList.ColumnCount = rs.ColumnCount
dataList.Column(-1).WidthExpression = "100"
For i As Integer = 0 To rs.ColumnCount - 1
dataList.Heading(i) = rs.ColumnAt(i + 1).Name
Next
// Add the data from the table
While Not rs.AfterLastRow
dataList.AddRow("")
For i As Integer = 0 To rs.LastColumnIndex
dataList.CellValueAt(dataList.LastAddedRowIndex, i) = rs.ColumnAt(i + 1).StringValue
Next
rs.MoveToNextRow
Wend
End Sub
If rs Is Nil Then Return
// set up listbox state for population
dataList.RemoveAllRows
// Add the DB columns as the heades for the ListBox
dataList.ColumnCount = rs.ColumnCount
dataList.Column(-1).WidthExpression = "100"
For i As Integer = 0 To rs.ColumnCount - 1
dataList.Heading(i) = rs.ColumnAt(i + 1).Name
Next
// Add the data from the table
While Not rs.AfterLastRow
dataList.AddRow("")
For i As Integer = 0 To rs.LastColumnIndex
dataList.CellValueAt(dataList.LastAddedRowIndex, i) = rs.ColumnAt(i + 1).StringValue
Next
rs.MoveToNextRow
Wend
End Sub