我想显示来自两个不同表格的数据。第二个表包含第一个表元素的cild元素。我希望像
一样展示它但我希望孩子的信息是连续的,我的意思是在品牌/列出Informarion的正下方。但在上面我遗漏了一些东西
我的VB代码
Dim dtListings As New DataTable()
Dim dtProducts As New DataTable()
Dim dt3 As New DataTable()
Dim ds = WebAppBA.GetListingWithProducts()
Dim ds2 = WebAppBA.GetProductsWithListings()
dtListings = WebAppBA.GetListingWithProducts().Tables(0)
dtProducts = WebAppBA.GetProductsWithListings().Tables(0)
If dtListings IsNot Nothing AndAlso dtListings.Columns.Count > 0 Then
For Each r As DataColumn In dtListings.Columns
dt3.Columns.Add(r.ColumnName)
Next
End If
If dtProducts IsNot Nothing AndAlso dtProducts.Columns.Count > 0 Then
For Each r As DataColumn In dtProducts.Columns
dt3.Columns.Add(r.ColumnName)
Next
End If
For Each row As DataRow In dtListings.Rows
dt3.NewRow()
dt3.ImportRow(row)
Dim v = dtProducts.[Select]("listingID=" & row("ID")).CopyToDataTable()
If v IsNot Nothing AndAlso v.Rows.Count <> 0 Then
For Each r As DataRow In v.Rows
dt3.ImportRow(r)
Next
End If
Next
还是有其他方法可以做到这一点