I'm not sure how relevant this might be...
Private Sub LoadData
Dim MyFixedTable as new datatable("edited results")
Dim colToSearch as String = "LAST_NAME"
Dim searchingFor as String = "Duck"
Dim expressionString as String = colToSearch & " LIKE '" & searchingFor & "'"
Dim returnedDataRows() as DataRow =
DatabaseForm.MyDataSet.MyDataBase.Select(expressionString)
if returnedDataRows.Length > 0
For idx = 0 to returnedDataRows.length - 1
Dim DataRow2Send as DataRow = returnedDataRows(idx)
FillMyFixedTable(MyFixedTable, DataRow2Send)
Next
FillInParents(MyFixedTable)
End If
End Sub
Private Sub FillMyFixedTable(ByRef FixedTable as DataTable, byval NewRow as DataRow)
Dim newDRow as FixedTable.NewRow
newDRow.Item(0) = NewRow.item(0)
newDRow.Item(1) = NewRow.item(1)
newDRow.Item(2) = NewRow.item(2)
newDRow.Item(3) = NewRow.item(3)
FixedTable.Rows.Add(newDRow)
End Sub
Private Sub FillInPArents(ByRef FixedTable as DataTable)
for idx = 0 to FixedTable.Rows.Count - 1
dim ParentTableRow as dataRow = FixedTable.Rows.Find(FixedTable.Rows(idx).Item(3))
if not ParentTableRow is nothing
FixedTable.Rows(idx).item(4) = ParentTableRow.Item(0)
else
FixedTable.Rows(idx).item(4) = ""
end if
Next
End Sub