var query = from p in myTable where p.Used = "N" group p by p.PartID into gp select new { PartID = gp.PartID, InstanceCount = gp.Count(), }
var counts = products.GroupBy(l => l.PartID).Select(lg => new { PartID = lg.Key, InstanceCount = lg.Count() });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)