cancel
Showing results for 
Search instead for 
Did you mean: 

Using AsEnumerable() in Code Stage

Anonymous
Not applicable
Hello,   I€™m building my own code stage and I would like to use AsEnumerable method on DataTable, something like below: Dim CustomerOrders = DtWithRecords.AsEnumerable().Select(Function(row) row.Field(Of Decimal)("ORDERNO")).Distinct()   Unfortunately, I'm receiving an error: Public member "AsEnumerable" on type "DataTable" not found.   I referenced System.Data.DataSetExtensions.dll on Initialise Page.   What I'm doing wrongly here?
5 REPLIES 5

AndreyKudinov
Level 10
Try adding namespace too

Anonymous
Not applicable
Tried it before, unfortunately didn't solve the problem.

John__Carter
Staff
Staff
It's telling you that whatever class the DtWithRecords object is does not have a AsEnumerable method

Anonymous
Not applicable
I know what is telling. Problem is that it shouldn't be a problem as I'm using System.Data.DataSetExtensions.dll on Initialise Page, which should be enough to use AsEnumerable on DataTable (and DtWithRecords is a Data Table).

VijayDodamani
Level 5
If you are using the LINQ query, then you should be refer below dll's and import the namespace: :\Windows\Microsoft.NET\Framework\v4.0.30319\System.Xml.Linq.dll :\Windows\Microsoft.NET\Framework\v4.0.30319\System.Core.dll :\Windows\Microsoft.NET\Framework\v4.0.30319\System.Data.DataSetExtensions.dll Namespace: System.Linq