Click here to Skip to main content
15,743,541 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to covert a DataTable into a List?
I Can do it by looping through the table and populating a list in iterations.

But Is there any other predefined methods are there to achieve this task?

Did you do a search first:[^]

If you're using .NET 3.5, you can use DataTableExtensions.AsEnumerable (an extension method) and then if you really need a List<datarow> instead of just IEnumerable<datarow> you can call Enumerable.ToList:

IEnumerable<datarow> sequence = dt.AsEnumerable();


List<datarow> list = dt.AsEnumerable().ToList();

First result from Google [^]:)
Share this answer
[no name] 12-Sep-12 10:36am    
Dang I answered the same thing. Deleted mine.
Kenneth Haugland 12-Sep-12 10:44am    
Great minds think alike or Google search for the answer :-D
Share this answer

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900