If you have any Typed DataType for list object something like this
public class MyObj
{
public string Name { get; set; }
public int ID { get; set; }
}
then you can do like this
private List test(DataTable dt)
{
var convertedList = (from rw in dt.AsEnumerable()
select new MyObj()
{
ID = Convert.ToInt32(rw["ID"]),
Name = Convert.ToString(rw["Name"])
}).ToList();
return convertedList;
}
or if you still want List
then do like this
private List