Convert DataTable To List in C#
Convert DataTable To List in C#
This article explains various ways to convert a DataTable to a List in C#. There are the
following 3 ways to convert a DataTable to a List.
1. Using a Loop.
2. Using LINQ.
3. Using a Generic Method.
Now I will convert the receding DataTable into a List< Student > using all the preceding
three methods.
The following are the two functions in which if we pass a DataTable and a user de�ned
class. It will then return the List of that class with the DataTable data.