nested LINQ query, error message

RhumhppiSo

New Member
I am currently trying to do a nested query in linq, but I am receiving an error message:\[code\]var subcatquery = from categories in mydb.Categories where categories.ParentId == null select new { category = categories.Name, subcat = (from sub in mydb.Categories where sub.ParentId == sub.Id select new { subcatItem = sub.Name, subcatId = sub.Id }) };\[/code\]Results View =\[code\]The type '<>f__AnonymousType0<subcatItem,subcatId>' exists in both 'myapplication.dll' and 'System.Web.dll'\[/code\]I can't underestand why.. if I remove the sub query and put it on it's own... it's perfectly fine.the \[code\]subcat\[/code\] type is a \[code\]collection<>\[/code\], is this where the problem is?
 
Back
Top