如何从数据表中选择自定义列? [英] How can i select custom columns from a data table?

查看:78
本文介绍了如何从数据表中选择自定义列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个数据表 dt1 ,其中包含一些列和行.我只需要动态地查看/选择数据表dt1中的自定义列.

数据表 dt1 具有列:itemnamebrandmodelcategorystockqty.
[所有列均取自不同的表格]

我只需要从数据表 dt2 和相应的行中选择itemnamestockqty.

任何人都可以帮助我...

Hi,


I have a data table dt1 with some columns and rows. I need to view/select only the custom columns from the data table dt1 dynamically.

data table dt1 has columns: itemname, brand, model, category, stockqty.
[all the columns are taken from different tables]

I need to select only itemname and stockqty from datatable dt2 and corresponding rows.

Any one please help me...

推荐答案

var FilteredDt=dt1.DefaultView.ToTable(false, "itemname", "stockqty");


这篇关于如何从数据表中选择自定义列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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