Such a Linq:
Dim Linq1=(From row1 As DataRow DataTable1. In AsEnumerable Join row2 As DataRow DataTable2. In AsEnumerable On row1. Field (Of Integer) (" Field 1) Equals row2. Field (Of Integer) (" Field 2 ")
The Select Field1=row1 field 1, Field3=row2. Field 3
Online to find solution is as follows:
'
1. Create tableDIM DataTable3 AS DataTable
Dim Linq2=(From row1 In Linq1. GetType (). The GetProperties ()). The ToList
For Each row1 Linq2 'In the test, here only three attributes: Count, Item, Capacity, no field,
Dim DataColumn1 As New DataColumn
DataColumn1. ColumnName=row1. Name
DataColumn1. DataType=row1. PropertyType
DataTable3. Columns. The Add (DataColumn1)
Next row1
DataSet1. Tables. The Add (DataTable3)
'2. Add the line
For J=0 To Linq1 Step 1 Count - 1
Dim Object1 As Object (Linq2. Count - 1)
For K=0 To Linq2. Step 1 Count - 1
=Linq2 Object1 (K) (K) GetValue (Linq1. Item (J), Nothing)
Next K
DataTable3. Rows. The Add (Object1)
Next J
I ask, where is the out of the question, how to solve? Or any other method of complete, detailed answer please!