I am converting a .NET Framework Winforms app into a .NET 6 project, and there is an error code that states "AsEnumerable is not a member of DataTable." My guess is LINQ is modified or unusable in .NET 6?
Code:Dim tarCols(numfields - 1) As String For i = 1 To numfields tarCols(i - 1) = Trim(FieldNames(i)) Next Dim arrayOfObjects As Object()() Try arrayOfObjects = dt.DefaultView.ToTable(False, tarCols).AsEnumerable().Select(Function(x) x.ItemArray).ToArray() Catch 'my exception code End Try




Reply With Quote
