Click here to Skip to main content
15,886,689 members
Articles / Web Development / ASP.NET

Convert Datatable to Collection using Generic

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
13 Aug 2011CPOL 21.1K   2  
Very nice!I've modified ToCollection(this DataTable dt) extension function, so if DataTable column names and class property names are different, then you can use this alternative:public static List ToCollection(this DataTable table, Dictionary dic){ List lst = new...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
16 Aug 2011Damian Flynn
Here's a couple of gems...From IList to DataTable.From DataTable to array of T.// DataTable: from IListpublic static DataTable ToDataTable(this IList iList){ DataTable dataTable = new DataTable(); PropertyDescriptorCollection propertyDescriptorCollection = ...
Please Sign up or sign in to vote.
12 Jun 2011nit_singh 2 alternatives  
This is an example to Convert from a datatable to a specific type of collection using Generic

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Georgia Georgia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions