I have two dataTable called A and B , i need all rows from A and matching row of B
A: B:
User | age| Data ID | age|Growth
1 |2 |43.5 1 |2 |46.5
2 |3 |44.5 1 |5 |49.5
3 |4 |45.6 1 |6 |48.5
And the Output will be
User | age| Data |Growth
------------------------
1 |2 |43.5 |46.5
2 |3 |44.5 |
3 |4 |45.6 |
In this case I got a solution from StackOverflow.com Link
var results = from data in userData
join growth in userGrowth
on data.User equals growth.User into joined
from j in joined.DefaultIfEmpty()
select new
{
UserData = data,
UserGrowth = j
};
It's working fine, but I am little bit confused there, What is the differences between join
and joined
in this LINQ Query
. Thank you.