>Hi everybody,
>
>I have 2 data tables dtInstructors and dtAllScheduled. I need to limit dtInstructors to only those that have corresponding rows in AllScheduled with Layer =1 and Flag = true.
>
>In Visual FoxPro this is done with the following query:
>
>
>IF empty(m.lcRequest)
> SELECT * FROM b_instr1 b WHERE exists ;
> (SELECT 1 FROM csrAllSched s WHERE s.resource1 = b.instr_id and s.layer = 1 and s.schdassign = .t.) ;
> ORDER BY instr_id INTO CURSOR b_instr readwrite
> ELSE
> SELECT * FROM b_instr1 b WHERE exists ;
> (SELECT 1 FROM csrAllSched s WHERE s.resource1 = b.instr_id and s.layer = 1 and s.schdassign = .t.) ;
> UNION ;
> SELECT * FROM b_instr1 WHERE ALLTRIM(instr_id) == m.lcRequest ;
> ORDER BY instr_id INTO CURSOR b_instr readwrite
> endif
>
>In my case I need to do a similar kind of query with LINQ and get back dtInstructors again. Do you know how this can be done?
>
>Thanks a lot in advance.
Exists becomes Any (
http://msdn.microsoft.com/en-us/library/vstudio/bb534972%28v=vs.100%29.aspx).
Union is still Union (
http://msdn.microsoft.com/en-us/library/vstudio/bb358407%28v=vs.100%29.aspx).