Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 LINQ 查询,它基本上将数据加载到数组中,然后加载到列表框中;这很好用。但我现在想做的只是选择不同的。我以前在 sql 中做过这个,但在 linq 中它对我不起作用。
感谢您的任何建议。
items = table .Where(row => row.author != "") .Take(150) .ToCollectionView();
Use the Distinct method ...
e.g.
query.Distinct().ToList();