Hello All,
I'm trying to run a Linq query on multiple data tables to produce a XML, filtered by Case_id . I'm following this example
Dataset to XML via Linq - Answered Fernando Soto - MCSD
I need left join "OtherDiag" table and it can have multiple or no records per case.
var results = from dtE in ds.Tables["EOC"].AsEnumerable()
from dtPD in ds.Tables["PrinDiag"].AsEnumerable().GroupBy(t => t.Field<string>("case_id"))
from dtOD in ds.Tables["OtherDiag"].AsEnumerable().GroupBy(t => t.Field<string>("case_id")).DefaultIfEmpty()
select new { dtE, dtPD, dtOD };
Please help. I am dealing with millions of data, so it has to be fast processing also.
Thanks for the help in advance.
LC