I am building a table based upon a set of queries that will determine what the columns of the table are. Which means that the column names will be dynamic. Each of these queries will have an id which we are using to match the correct data to the correct user.
Here is what the data looks like:
Base Table
Sub Table
The code I am using is
Dim tablesJoined = From t1 In dt1.AsEnumerable()
Join t2 In flatTable.AsEnumerable()
On t1.Field(Of String)("SHM_ID")
Equals t2.Field(Of String)("SHM_ID")
However, I want to select all of the values for dt1 and merge the data from the second table into it. For further context, I will be doing this several times, so I can't just use a static object.
Is there a way to put these two tables together in an elegant manner?
It would look something like this: