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
答案 0 :(得分:2)
对不起,这是linqToExcel特有的问题
A-PR-UWY-Z
需要值列进行修复