Tutorial :Derived tables in Linq to SQL



Question:

I would like to implement this in Linq to SQL:

select * from (      select * from Orders) as A  

Obviously this is a pointless example, but I just can't figure out how to do it!


Solution:1

Try something like this:

var subquery = from row in Orders select row;  var query = from row in subquery select row;  


Solution:2

using (var dc = new NorthwindDataContext())  {               var A = from ordOuter in                   from ordInner in dc.Orders                   select ordInner               select ordOuter;  }  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »