I have a datatable dt
with a single column and a list of strings. If I want to change this to a list (for example, to make it easier to compare with another list) I would default to something like:
var ls = new List<string>();
foreach (DataRow dr in dt.Rows)
{
ls.Add(dr["COLUMN_NAME"].ToString());
}
I don't think it's possible to get more efficient than that, but is there shorter way to write this, maybe using LINQ?