如何将多个数据视图合并为一个? [英] How to merge multiple dataviews into one?

查看:574
本文介绍了如何将多个数据视图合并为一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有三个数据视图(dataview1,dataview2和dataview3)。它们的类型为System.Data.DataView,并且所有三个具有相同的列。是否有一种简单的方法可以将它们合并为一个,所以我有一个dataview,其中包含dataview1中的行,然后是dataview2,然后是dataview3?

I have three dataviews (dataview1, dataview2, and dataview3). These are of type System.Data.DataView, and all three have the same columns. Is there an easy way to merge them into one, so I have one dataview with rows from dataview1, followed by dataview2, and then dataview3?

推荐答案

Dim dataview1 As DataView = new DataView()
Dim dataview2 As DataView = new DataView()

'' given the tables are not null you can then merge like this

dataview1.Table.Merge(dataview2.Table)

这篇关于如何将多个数据视图合并为一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆