如何过滤数据集中的数据 [英] how to filter the data in dataset

查看:76
本文介绍了如何过滤数据集中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是asp.net的新手,如何在不使用数据视图和数据表的情况下使用vs 2008中的下拉选择来过滤数据集中的数据.


i am new to asp.net.how can i filter the data in dataset using dropdown selection in vs 2008 without using data view and data table.

推荐答案

DataSet不存在实际上,如果没有DataTable,则实际上将您放入DataSet的内容放入了DataTable.如果要过滤数据集中的数据,则必须通过DataTable.

可选的是,将数据复制到List< List>中.每次要过滤时都从数据集中进行过滤,过滤列表并将数据放回数据集中.不幸的是,对于这样一个不完整的问题,这是我所能做的最好的.除非您改善问题(特别是使用下拉菜单"位),否则我会改善我的建议.
DataSet cannot exist without DataTable, infact, what you put in a DataSet actually goes into DataTable(s). If you want to filter data in a dataset, you would have to go via the DataTable.

Alternative is, to copy the data to a List<> from a dataset everytime you want to filter, filter the list and put the data back into the data set. Unfortunately, for an incomplete question like that, this is the best i can do. Unless, you improve the question ("using dropdown" bit specifically) in which case i will improve my suggestion.


这篇关于如何过滤数据集中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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