I have two seperate datatables, one of integers and one of strings. Both are 3x3 in size and I want to simply merge the two tables and show them in a datagridview so that I show a 3x6 datagridview.

And I want to put the two together to get the image below

Dim stringtable As New DataTable
stringtable.Columns.Add("PK", GetType(Integer))
stringtable.Columns.Add("Col1", GetType(Integer))
stringtable.Columns.Add("Col2", GetType(Integer))
stringtable.Columns.Add("Col3", GetType(Integer))
stringtable.Rows.Add(1, 1, 1, 1)
stringtable.Rows.Add(2, 2, 2, 2)
stringtable.Rows.Add(3, 3, 3, 3)
Dim primaryKey(1) As DataColumn
primaryKey(0) = stringtable.Columns("Name")
stringtable.PrimaryKey = primaryKey
Dim Inttable As New DataTable
Inttable.Columns.Add("PK", GetType(Integer))
Inttable.Columns.Add("ColA", GetType(String))
Inttable.Columns.Add("ColB", GetType(String))
Inttable.Columns.Add("ColC", GetType(String))
Inttable.Rows.Add(1, "A", "A", "A")
Inttable.Rows.Add(2, "B", "B", "B")
Inttable.Rows.Add(3, "C", "C", "C")
primaryKey(0) = Inttable.Columns("Name")
Inttable.PrimaryKey = primaryKey
DataGridView2.DataSource = stringtable
DataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill
DataGridView2.AllowUserToAddRows = False
DataGridView1.DataSource = Inttable
DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill
DataGridView1.AllowUserToAddRows = False
''This is where I can't figure out what do
Dim mergedTable As New DataTable
mergedTable = DataGridView2.DataSource
mergedTable.Merge(Inttable, False, MissingSchemaAction.Add)
DataGridView3.DataSource = mergedTable
I have tried a few things but cannot seem to get this right. Sometimes it populates a 6x6 datagridview with 12 blank cells and other times it keeps the values of one datatable but puts blanks for all the values of the second.
EDIT I've edited my code to reflect the addition of a primary key to the datatables but now for some the table populates with blank cells. Can someone tell me why the datatables wont just merge on the primary without leaving blanks
