var detailGroups = headerGroup
.GroupBy(d => d.CompanyCode)
.Select(d => new { CompanCode = d. }); Thanks.
var detailGroups = headerGroup
.GroupBy(d => d.CompanyCode)
.Select(d => new { CompanCode = d. }); Thanks.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Feb 16, 2012, 6:18 PM EST
try,
var detailGroups = (from t in headerGroup
group t by new
{
t.CompanyCode
}
into groupFiles
select new
{
groupFilesCompanyCode
});
hope this help.
DanYeung7 reputationPosted Feb 16, 2012, 7:58 PM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Feb 16, 2012, 8:51 PM EST
In your query select work only on "headerGroup" so when use group by the you get collection of "headerGroup" depend on companycode.
i.e.
.Select(d => d);
this query automatically convert your group by query.kindly provide more detail on same, means table structure and more..
hope this help.
DanYeung7 reputationPosted Feb 17, 2012, 5:36 AM EST
Thanks.
VulpesRank #55 · 29.2K reputationPosted Feb 17, 2012, 6:23 AM EST