10
I have a DataTable, say pdt, in my code. I just want to select all table["id"] and populate then in an integer array.
I can go ahead with a foreach but I am trying to learn Lambda expressions.
I can't figure out how to deal with this.
I have tried
List<int> Ids = pdt.Select(row => row["Id"]; return Convert.ToInt32(r));
and
int[] Ids = pdt.Select(row => row["Id"]);
but nothing seems to work. I am pretty sure this is a basic question, help out a newbie please.