如何从ap.net中的Dataset获取特定列 [英] how to get Specific columns from Dataset in ap.net

查看:62
本文介绍了如何从ap.net中的Dataset获取特定列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我有dataSet。我想从dataSet中获取特定的多个列并添加到Datatable中。如何实现这个???

Hello,
I have dataSet. i want to take specific multiple columns from dataSet and add into Datatable. how to achieve this ???

推荐答案

你好,

首先复制主表并从新生成的表中删除不需要的列。

Hello ,
First Copy the Main table and remove the unwanted columns from the new generated table .
DataTable newdt;
newdt=ds.Tables[0].Copy(); //here assuming  the main table exists in 0th position.
//now remove the unwantd columns
newdt.Columns.Remove("1stcolumn");





谢谢

animesh



thanks
animesh


这篇关于如何从ap.net中的Dataset获取特定列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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