how can this be done in LINQ?

Jun 22 2013 3:46 PM
i have two datasets that i need to join
the first dataset is the main one and has almost all the data
the second dataset has two colums of data that i need to add to the first dataset
so in that sense......it's a simple join

but here's my problem........

wow....this is so hard to explain............
i need to use dataset1 and then join it to dataset2 on.....lets say employeeid
dataset2 can have 0,1 or 2 matching records
there is a field in dataset2 called recordtype. if a recordtype "A" exists in dataset2, then i want to match on that row. if a recordtype "A" does NOT exist, then lets see if there is a recordtype "B". if it exists, then match on that row. so......if BOTH exist, always choose "A" - if NEITHER "A" or "B" exist, then return asterisks.
does that makes sense?
i'm guessing it needs to be some kind of "coalesce" but i have not been able to construct it

the join columns will always be the same......
but the colums i select to return are conditional

anyone?

Answers (1)