Thursday, January 31, 2013 3:35 AM
Hi, I am trying to get a patients records from a detail table based on the entries in the patient table, detail table contains details for patients, doctors nurses. In sql I would write a simple nested select but need to do it in Linq! Any ideas how I could do this bearing in mind that I actually need no data from the patient table except for the detail number so I can use that to get the data out the detail table.
Here is part of my erd to illustrate my design!
Thursday, January 31, 2013 8:04 AM
I'm having a blog post about performing INNER JOIN operation with LINQ and I'm also discribing INNER JOIN operation using nested queries take a look, maybe it can help you
Please Mark as Reply and Vote as Helpful if I helped.
Also please visit my blog http://msguy.net/
- Marked As Answer by soulchyld Thursday, January 31, 2013 1:46 PM
Thursday, January 31, 2013 1:46 PM
I can't see the illustration, but you can write it as two statements.
var dict = from row in contect.InnerTable where whatever == 4 select row.Id; var query = from row in context.OuterTable where dict.Contains(row.ForeignKey) select row;
Thursday, January 31, 2013 1:47 PMThanks,