I've never found an elegant way to do this, so I'm wondering what methods other developers prefer (for performance, readability, etc).
Is there a way to use the LIKE operator in the DataTable.Select() function, based on the results of a query to another DataTable. For example, in SQL Server, the syntax would be:
Select SomeValue
From Table1
WHERE MyField IN
(Select SomeField From Table2 Where SomeColumn = SomeFilterVariable)
I know that from a coding standpoint, this is a very simple query to do against the DB, but this is being done in an app where doing it this way would result in hundreds of thousands of calls to a server due to the number of calculations involved. I've timed it, and it's much better to go get all the data at once and use DataTable.Select() or DataTable.Compute() to get the results I need.
I'm open to anything including LINQ to datasets, etc. What I really need to avoid is a lot of trips to the server.