Hello,

I'm using this code to get a subquery :

Code:
dim lnQ = (From data In tblData _
             Where data.Genre_Id = "1" _
             OrElse (From genre In tblStructure _
                          Where genre.parent_Id = "1" _
                     Select genre.Id).Contains(data.Genre_Id) _
             Select data).ToList


Basically, I have 2 datatables

- The first is a Treeview structure
Code:
Category (.id="1")
  |- Genre a (.id="13")
  |- Genre b (.id="15")
  |- ...
  |- Genre n
- The second keeps the data (20.000 rows)


I need to pull "all rows from the category, including all rows from it's subcategories"

My code works, but it has dramatic results (20/30 seconds to get it done), when I need an instant response. I know the .Contains is really bad.

What would be a good fix to totally get rid of the .contains ???

Thanks in advance!