摘要: 在下面的示例中,DisplayProducts 方法接收一个数据表,其中包含名为 ProductName一个 DataColumn,提取 ProductName 值,然后输出值。 using System;using System.Data;class Program { public void DisplayProducts(DataTable table) { var productNames = from products in table.AsEnumerable() select products.Field("ProductName"); Console.... 阅读全文
posted @ 2014-04-02 14:52 Seaurl 阅读(1367) 评论(4) 推荐(0) 编辑
摘要: C# DataTable 转 List 方法,网上有好多,之前也收集了,感觉这个也不错,重要是自己要领会这里面的代码含义。接不来我就把代码贴出来分享一下,大家觉得如果不好,请留言我,我来改进。using System;using System.Collections.Generic;using System.Data;using System.Reflection;namespace jdrz.HumanIdentify{ public class Helper { /// /// DataTable 转换为List 集合 /// ... 阅读全文
posted @ 2014-04-02 08:46 Seaurl 阅读(5267) 评论(58) 推荐(1) 编辑