Click here to Skip to main content
Click here to Skip to main content

Convert Datatable to Collection using Generic

, 16 Aug 2011
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 = ...

Alternatives

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

13 Aug 2011
Vano Maisuradze
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...
12 Jun 2011
nit_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)

Share

About the Author

Damian Flynn

United States United States
No Biography provided

| | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 16 Aug 2011
Article Copyright 2011 by Damian Flynn
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid