datatable去掉重复行的方法
时间:2023-09-02 19:59:41
去掉DataTable中(所有列的数据都相同)重复的行:
//DataView dv = dt3.DefaultView; //dt3默认的虚拟视图
//dv.Sort = "wmid asc"; //排序
///dv.ToTable(true, "列名,列名,列名");
///第一个参数,true 去除重复,false 不去除
///第二个参数,需要显示的字段
DataView dv = new DataView(dtname); //dtname指需去掉重复行的datatable名
dtname = dv.ToTable(true);
标签:c#,datatable
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
SpringMVC RESTFul实体类创建及环境搭建
2022-12-25 18:23:06
![](https://img.aspxhome.com/file/2023/7/63297_0s.png)
c#定时器和global实现自动job示例
2023-10-04 22:30:29
Spring JPA find单表查询方法示例详解
2022-11-03 19:43:38
Android RecyclerView加载不同布局简单实现
2022-07-15 16:57:09
![](https://img.aspxhome.com/file/2023/9/139219_0s.gif)
C++实现哈夫曼编码
2022-07-20 20:39:01
JavaFX实现简单日历效果
2023-05-16 08:43:30
![](https://img.aspxhome.com/file/2023/5/61325_0s.jpg)
基于WPF实现筛选下拉多选控件
2021-11-15 20:47:50
![](https://img.aspxhome.com/file/2023/4/69784_0s.png)
Maven引入本地Jar包并打包进War包中的方法
2023-06-16 12:43:28
![](https://img.aspxhome.com/file/2023/6/62966_0s.png)
C#获取Windows进程监听的TCP/UDP端口实例
2021-11-20 13:06:21
Spring createBeanInstance实例化Bean
2023-06-17 17:26:27
SpringMVC中的Model对象用法说明
2022-12-15 02:24:34
springmvc+shiro自定义过滤器的实现代码
2021-08-11 21:23:11
![](https://img.aspxhome.com/file/2023/9/73059_0s.png)
SpringBoot打Jar包在命令行运行流程详解
2023-11-24 16:53:59
![](https://img.aspxhome.com/file/2023/8/59548_0s.png)
maven仓库中心mirrors配置多个下载中心(执行最快的镜像)
2023-05-04 22:08:33
![](https://img.aspxhome.com/file/2023/3/90973_0s.png)
Java网络编程TCP实现聊天功能
2023-12-01 17:05:35
![](https://img.aspxhome.com/file/2023/1/103851_0s.jpg)
C#线程定义和使用方法详解
2022-08-18 00:51:51
![](https://img.aspxhome.com/file/2023/4/77264_0s.jpg)
C#非矩形窗体实现方法
2023-04-09 15:11:39
Android超实用的Toast提示框优化分享
2022-12-20 08:36:32
C#的String和StringBuilder详解
2022-06-21 09:51:31
![](https://img.aspxhome.com/file/2023/4/98174_0s.gif)
Android Activity的启动过程源码解析
2023-12-25 11:16:00
![](https://img.aspxhome.com/file/2023/4/138514_0s.png)