C# - AsEnumerable例 [英] C# - AsEnumerable Example

查看:1534
本文介绍了C# - AsEnumerable例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是AsEnumerable的确切用途?它会改变不可枚举的集合来枚举
系列?。请给我一个简单的例子。

What is the exact use of AsEnumerable? Will it change non-enumerable collection to enumerable collection?.Please give me a simple example.

推荐答案

阅读的答案后,我想你仍然缺少一个实际的例子。

After reading the answers, i guess you are still missing a practical example.

我用这使我能够在一个DataTable

I use this to enable me to use linq on a datatable

var mySelect = from table in myDataSet.Tables[0].AsEnumerable()
            where table["myColumn"].ToString() == "Some text"
            select table;

这篇关于C# - AsEnumerable例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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