O'Reilly logo

Visual Basic 2008 Recipes: A Problem-Solution Approach by Rakesh Rajan, Matthew MacDonald, Allen Jones, Todd Herman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6.11. Query Data from Multiple Collections

Problem

You need to execute a query based on the combined data from multiple collections.

Solution

Create a standard LINQ query, such as the ones described by the previous recipes in this chapter, and use the Join clause to join the data from multiple sources.

How It Works

If you have any experience with SQL, or other query languages, you will most likely recognize the need to join data from multiple sources. One of the most popular join functions available to Microsoft T-SQL is INNER JOIN, which returns only the elements from the first source that match elements in the second.

The.NET Framework 3.5 supplies the Join clause, which provides functionality equivalent to an inner join. Here is an example: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required