An Extensive Examination of LINQ: Grouping and Joining Data

Posted by: 4GuysFromRolla.com Headlines, on 05 Aug 2009 | View original | Bookmarked: 0 time(s)

As discussed in An Introduction to LINQ, one of the cornerstones of LINQ is the standard query operators, which are a set of extension methods on the IEnumerable interface added to the .NET Framework version 3.5. The standard query operators can be applied to any enumeration - any collection of "things." In The Standard Query Operators installment we looked at some of the more common query operators, such as Where, Select, OrderBy, and others. Each standard query operator can be classified as a certain type of operator. There are aggregation operators like Count, Sum, and Max; element operators like First, Last, and ElementAt let you pick out a specific element from a sequence; and the ordering operators OrderBy and OrderByDescending order the elements of a sequence based on a specified sorting criteria.

Another class of query operators that we've yet to explore are grouping and joining operators. The grouping and joining operators work with two (or more) sequences and combine them together, much like how a JOIN in SQL combines records from two (or more) tables into a single resultset. Through LINQ's standard query operators (or via its query syntax), it is possible to perform: nested (or grouped) queries; cross joins, or the Cartesian product of two sequences; inner joins; and left outer joins.

This article explores the grouping and joining operators available in LINQ with a number of examples in both Visual Basic and C#. As with the previous installments in this article series, the complete code is available for download. Read on to learn more!
Read More >

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: XLinq | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 1495 | Hits: 56

Similar Posts

  • Introducing Versatile DataSources more
  • Chat room questions from the EF Tips & Tricks webcast more
  • Using Microsoft's Chart Controls In An ASP.NET Application: Plotting Chart Data more
  • Silverlight Release History : Q2 2009 (version 2009.2.701) more
  • WPF Release History : Q2 2009 (version 2009.2.701) more
  • Better XAML By Farr: WPF Line of Business Seminar more
  • WPF / Silverlight: RadChart and BindableLinq more
  • CodeDigest.Com Article,Codes,FAQs - April,2009 more
  • .NET RIA Services MIX '09 Talk - Slides + Code more
  • What is .NET RIA Services? more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD