• 一些常用的方法(1)--去除DataTable中的重复数据


       private DataTable Display(DataTable dtSource)
            {
                DataTable dtTemp = dtSource.Copy();
                foreach (DataRow dr in dtSource.Rows)
                {
                    DataRow[] drRepeat = dtTemp.Select("AA='" + dr["AA"].ToString().Trim() + "' and BB='" + dr["BB"].ToString().Trim() + "'");
                    if (drRepeat.Length > 1)
                    {
                        for (int i = 0; i < drRepeat.Length - 1; i++)
                        {
                            dtTemp.Rows.Remove(drRepeat[i]);
                        }
                    }
                }
                return dtTemp;
            }

  • 相关阅读:
    Python中 sys.argv[]的用法简明解释
    python多线程
    python 多进程
    shell----bash
    linux crontab
    Elastic search 概述
    Elastic search 入门
    Elastic search CURL命令
    Elastic search 基本使用
    Elastic search 字段折叠 collaose
  • 原文地址:https://www.cnblogs.com/mengzhixingping/p/3914243.html
Copyright © 2020-2023  润新知