A simple way is to use AsEnumerable () in tables and combine them into common column data.
, : [Table1] -> [ID] [Name] [Location] | [Table2] -> [ID] [Description],
DataTable table1 = new DataTable();
table1.Columns.Add("ID", typeof(int));
table1.Columns.Add("Name", typeof(string));
table1.Columns.Add("Location", typeof(string));
table1.Rows.Add(1, "Name1", "Location1");
table1.Rows.Add(2, "Name2", "Location2");
table1.Rows.Add(3, "Name3", "Location3");
DataTable table2 = new DataTable();
table2.Columns.Add("ID", typeof(int));
table2.Columns.Add("Description", typeof(string));
table2.Rows.Add(1, "Description1");
table2.Rows.Add(2, "Description2");
table2.Rows.Add(3, "Description3");
ID
var joinedTables = from data1 in table1.AsEnumerable()
join data2 in table2.AsEnumerable() on data1.Field("ID") equals data2.Field("ID")
select new { id= data1.Field("ID"),
name = data1.Field("Name"),
loc = data1.Field("Location"),
desc = data2.Field("Description")
};
:
id name loc desc
1 Name1 Location1 Description1
2 Name2 Location2 Description2
3 Name3 Location3 Description3