如何动态地将数据集转换为通用列表 [英] How to convert the dataset to Generic list dynamicaly

查看:62
本文介绍了如何动态地将数据集转换为通用列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下午好,我正在尝试将数据集动态转换为通用列表,但我没有做到这一点,所以任何人都可以给我举个例子,在此先谢谢…….

Hi good afternoon i am trying convert the dataset into generic list dynamically i am not getting how i can do that so can anyone please give me an example please thank in Advance.......

推荐答案

这是将数据集转换为DataRow列表的一种方法.


This is one way of converting the dataset to a List of DataRow.


List<DataRow> dList = ds.Tables[0].Select().ToList<DataRow>();



或看看那个

使用通用将数据表转换为集合 [



or have a look on that

Convert Datatable to Collection using Generic[^]


数据集包含一个数据表的集合,每个表都包含一个数据行的集合.您希望如何将其转换为List< object> ?
A DataSet contains a collection of DataTables, each of which contains a collection of DataRows. How do you expect to convert that into a List<object> ?


这篇关于如何动态地将数据集转换为通用列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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