Results 1 to 7 of 7

Thread: [RESOLVED] Using AsEnumerable for a DataTable in .NET 6?

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2022
    Posts
    83

    Resolved [RESOLVED] Using AsEnumerable for a DataTable in .NET 6?

    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
    Last edited by pel11; Jan 15th, 2023 at 04:11 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width