惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
LINUX DO - 热门话题
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Project Zero
Project Zero
V
Vulnerabilities – Threatpost
Cisco Talos Blog
Cisco Talos Blog
P
Palo Alto Networks Blog
C
Cisco Blogs
A
Arctic Wolf
月光博客
月光博客
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
量子位
小众软件
小众软件
Latest news
Latest news
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
N
Netflix TechBlog - Medium
K
Kaspersky official blog
人人都是产品经理
人人都是产品经理
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
Y
Y Combinator Blog
P
Proofpoint News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
S
Schneier on Security
D
Docker
Scott Helme
Scott Helme
MyScale Blog
MyScale Blog
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
GbyAI
GbyAI
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
H
Help Net Security
Simon Willison's Weblog
Simon Willison's Weblog
J
Java Code Geeks
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tenable Blog
B
Blog
Know Your Adversary
Know Your Adversary
IT之家
IT之家

博客园 - 追逐苦痛

20230509001 - DataTable 导出成Excel 20230425001 - DataGridView绑定了数据之后, 再添加CheckBox列的解决方案 20230424001 - 打开文件对话框OpenFileDialog类 20200812001 - SQL openquery 传参数 ASP.net用Graphics实现的统计图(折线图、柱状图、饼图) 20190917002 - SQL 中处理交叉重复条件参考 20190410001 - 遍历控件参考 20180709001 - 委托传值 20180706001 - 动态添加 tabPage 20180519001 - DataTable Group by功能参考 20161020001 DataGridView 选中的 DataGridViewCheckBoxCell 不添加重复项 20161014006 DataGridView Combobox 数据绑定与传值 20161014001 DataGridView 单元格内容 自动计算 20161013001 DataGridView 数据转 DataTable 20161011001 treeView 递归 20160929001 Guid生成 20160815001 - 修改字段的长度 20160715001 - 分发与订阅 总结 20160712001 SQL server R2 更名
20190917001 - 去除DataTable中重复的数据
追逐苦痛 · 2019-09-17 · via 博客园 - 追逐苦痛

                // 去除DataTable中重复的数据需要用到DataView,代码如下:
                DataView dv = new DataView(dt1);//_dt是一个DataTable类型的变量
                //dt1 = dv.ToTable(true, "业务员");
                //第一个参数为true,去除重复数据,false不去除。
                //第二个参数需要显示的字段
                dt1 = dv.ToTable(true, "业务员");//去除name列名字相同的,并显示name列。

                this.dataGridView1.DataSource = dt1;
                this.textBox1.Text = dt1.Rows.Count.ToString();

posted @ 2019-09-17 16:03  追逐苦痛  阅读(200)  评论(0)    收藏  举报