var ItemMaster = new ExcelQueryFactory("E:\\Group Item Master.xlsx");
var ItemList = (from x in ItemMaster.Worksheet()
select new
{
CategoryName = x["CategoryName"],
GroupName = x["GroupName"],
ModelNo = x["ModelNo"],
Description = x["Description"],
Code = x["Code"]
}).ToList();
var DistinctCategory = ItemList.Select(x => x.CategoryName).ToArray().Distinct();
//shows categoryname repeated
var iteml = ItemList.GroupBy(x => x.CategoryName);
var DistinctCategoryTwo = iteml.Select(x => x.First()).ToList();
//shows categoryname repeated
C# LinqToExcel, Distinct showing all results - tried online solutions, couldn't solve
129 Views Asked by Arun Prasad E S At
1
Sorry guys, it was linqToExcel specific issue
value column was needed to fix it