Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting same data table after LINQ query
Message
From
10/06/2014 17:16:19
 
General information
Forum:
ASP.NET
Category:
LINQ
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01601612
Message ID:
01601618
Views:
32
>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).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform