[Solved] Need not to print Duplicates values using c# [closed]


You can use the GroupBy linq extension method:

foreach (var group in m_USTByDoctor_OPDC.ml_trn_bill_item.GroupBy(i => i.ItemName))
{
    Add_Cell(group.Key, ref tbl_summaryContent3, HELVETICA_BOLD_8_BLACK, false, Rectangle.ALIGN_LEFT, Rectangle.ALIGN_MIDDLE);
    Add_Cell(group.Count().ToString(), ref tbl_summaryContent3, HELVETICA_NORMAL_8_BLACK, false, Rectangle.ALIGN_LEFT, Rectangle.ALIGN_MIDDLE);
}

3

solved Need not to print Duplicates values using c# [closed]