private void CheckKey(DataTable dt ,string key)
        {
              DataTable m_tData = dt;
              var qt = m_tData.AsEnumerable().
                GroupBy(p => p[key]).
                Where(p => p.Count() > 1).
                Select(p => new { key = p.Key, value = p.Count() }).ToList();
                     foreach (var t in qt)
                {
                    Console.WriteLine("键值:{0} 重复次数:{1}", t.key, t.value);

                }
   }

相关文章:

  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
  • 2021-12-21
  • 2021-07-16
猜你喜欢
  • 2021-11-22
  • 2021-11-18
  • 2021-10-26
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案