In C# that would be:
var q = from adv in dc.Advice
join iso in dc.InformixSource on adv.DSSERVER equals iso.PODServerName
join sif in dc.SiteInfo on iso.SiteNum equals sif.SiteNum
group sif by new { sif.SiteName, sif.SiteNum } into sg
orderby sg.Key.SiteNum
select new { count = sg.Count(), sg.key.SiteName };
In VB (sorry if I get something wrong, I'm not very good at VB linq syntax), it would be something like:
dim q = From adv In dc.Advice _
Join iso In dc.InformixSource on adv.DSSERVER Equals iso.PODServerName _
Join sif In dc.SiteInfo on iso.SiteNum Equals sif.SiteNum _
Group New With { sif.SiteName, sif.SiteNum } By key = New With { sif.SiteName, sif.SiteNum } Into Group _
Order By key.SiteNum _
Select New With { .count = Group.Count(), .SiteName = key.SiteName }
A great reference to commonly used Linq syntax is Damien Guard's "linq to sql cheat sheet":
http://damieng.com/blog/2009/08/12/linq-to-sql-cheat-sheet
 |
|
Cool tools for Linq-to-SQL and Entity Framework 4:
huagati.com/dbmltools -
Rule based class and property naming, Compare and Sync model <=> DB, Sync SSDL <=> CSDL (EF4)
huagati.com/L2SProfiler -
Query profiler for Linq-to-SQL and Entity Framework v4 |