How to skip the first row of a foreach loop in C#?

Hello community!

I’m trying to skip the first row of the datatable variable TempAll but am unsure of the condition I need to place for the if statement and I believe that my botched attempt at converting the VB code for skipping the first row as seen in the Assign Activity is also another problem… any advise would be greatly appreciated :slight_smile: !


I got the VB code from this page on the UiPath forums

Hi @lmoham

Please try this

TempAll = TempAll.asenumerable().skip(1).copytoDatatable()

Hi thanks for replying, am met with an error regardless of whether its a lowercase or capital ‘E’.

Hi Imoham,

Refer to this, you may have this issue.
[AsEnumerable is not a member of 'System.Data.Datatable'](AsEnumerable is not a member of 'System.Data.Datatable'

Kah Liang

thanks but the error still persists

Is it the same error or different error this time?


and yes I stopped the xaml file before writing the extension into notepad

Do you mind removing the whole sequence of IF statement? Sometimes the error go away after you recreating the activity after that.

Then try again by assign TempAll = TempAll.AsEnumerable().Skip(1).CopytoDataTable()

Else, try to create a new project with the assembly reference.


Thanks the first solution got rid of the problem!

Thanks Kah Liang and @prasath_S !

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.