using System.Collections.Generic;
public static void Main()
DataTable tableA = new DataTable();
tableA.Columns.Add("ACol1",typeof(string));
tableA.Columns.Add("ACol2", typeof(string));
tableA.Columns.Add("ACol3", typeof(string));
DataTable tableB = new DataTable();
tableB.Columns.Add("BCol1", typeof(string));
tableB.Columns.Add("BCol2", typeof(string));
tableB.Columns.Add("BCol3", typeof(string));
DataRow row1 = tableA.NewRow();
DataRow row2 = tableA.NewRow();
DataRow row3 = tableA.NewRow();
DataRow row4 = tableA.NewRow();
DataRow row5 = tableA.NewRow();
DataRow row6 = tableB.NewRow();
DataRow row7 = tableB.NewRow();
DataRow row8 = tableB.NewRow();
DataRow row9 = tableB.NewRow();
var result = from a in tableA.AsEnumerable()
from b in tableB.AsEnumerable()
where a.Field<string>("ACol1") == b.Field<string>("BCol1")
|| a.Field<string>("ACol1") == b.Field<string>("BCol2")
Console.WriteLine("ACol1\tACol2\tACol3\tBCol3");
Console.WriteLine("-----------------------------------");
foreach (var item in result)
Console.WriteLine("{0}\t{1}\t{2}\t{3}", item.ACol1, item.ACol2, item.ACol3, item.BCol3);