4
shouts

Web 2.0 | Implementing a Cross Join with LINQ

posted by farooqkaiserfarooqkaiser 245 days, 4 hours, 13 minutes ago
Tuesday, July 14, 2009 2:39:56 PM GMT

A cross join or Cartesian join is the basis for every other join. The following query will produce all of the combinations of two tables using LINQ

var query = from c in customers                  from p in products                select new               {               c.CompanyName,                     p.ProductName              };

Querying DataSet, you can write the following Query with dataset.

var query = from c in ds.Tables["Table1"].AsEnumerable()                   from p in ds.Ta...

category: ASP.NET | clicked: 14 | | source: www.fairnet.com | show counter code
tags: C# 3.5, Linq

No comments yet, be the first one to post comment.

To post your comment please login or signup