while i know i can make a join of 2 rows via sql, my program doesn\'t use it i have 2 datatables and i take each row, compare to the rows on the other table and want to make
Here's an example of two ways to do join using LINQ.
var t1 = new DataTable();
var t2 = new DataTable();
t1.Columns.Add("id", typeof (Int32));
t1.Columns.Add("data", typeof (String));
t2.Columns.Add("id", typeof (Int32));
t2.Columns.Add("data", typeof (Int32));
t1.Rows.Add(new {id=1, data="John"});
t1.Rows.Add(new {id = 2, data = "Mary"});
t2.Rows.Add(new {id = 1, data = "100"});
t2.Rows.Add(new {id = 2, data = "200"});
var results = from x in t1.Select()
join y in t2.Select() on (Int32) x["id"] equals (Int32) y["id"]
select (new {id = x["id"], name = x["data"], number = y["data"]});
var lamdaResults = t1.Select().Join(
t2.Select(), x => x["id"], y => y["id"],
(x, y) => new {id=x["id"], name=x["data"], number=y["data"]});