How to Convert DataTable into List in C# ?
In this article, we are going to convert DataTable into a List in C#. There are three ways to do it. We will see in following simple program how to do it. The program is self-explanatory in the form of code comments. Code Snippet:- using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace BlogsProgram { public class Program { // Creating an Entity class for Employee public class Employee { public int EmpID { get; set; } public string EmpName { get; set; } public string City { get; set; } } public static void Main(string[] args) { // Creating Object of Program class to access its Members Program _obj_Program = new Program(); // Defined Tabble as "Employee". DataTable dt = new DataTable("Employee"); // ...