CSharp examples for System.Collections.Generic:List
DataTable To List
using System.Reflection; using System.Data; using System.ComponentModel; using System.Collections.Generic; using System;/* ww w . ja v a 2 s . c o m*/ public class Main{ public static IList<T> ToList<T>(this DataTable table) { if (table == null) return null; var rows = new List<DataRow>(); foreach (DataRow row in table.Rows) { rows.Add(row); } return ToDataTable<T>(rows); } }