Converting class object to datarow using LINQ in vb.net.
问题 I have a list of class objects. I have a data table along with columns created. I need to insert all the data from the list into the data table. I am unable to get the LINQ right in vb.net. I have done the same using a for each loop, but i am looking out for the LINQ code. Sample code Private Function ToDataTable(ByVal sampleData As List(Of ClassA)) 'data table Dim dt As New DataTable 'add columns Dim column As DataColumn column = New DataColumn("Name") dt.Columns.Add(column) column = New