Combining Two IEnumerables of UiElements into a Single DataTable with LINQ

@ashwin.ashok
lets assume

  • both Lists have reliable same count of items
  • the datatable col structure is 2 cols (name,adress) and an empty datatable is available - dtFinal

Give a try on

(From i in Enumerable.Range (0, ListName.Count)
Let ra = {ListName,ListAddr}.Select(Function (x) x(i).Get(“innertext”)).toArray
Select dtFinal.Rows.Add(ra)).CopyToDataTable

ListName = your List_UIElement of the names

2 Likes