One dimensional error of system data datarow cannot be converted to 'system.data.datatable'

Hi ,
While im trying to do the “Practical Exercise -Walk through”,One dimensional error of system data datarow cannot be converted to ‘system.data.datatable’ error is displayed when in for loop.
Please find the attached sequence snapshot.

Usually in for each row loop we can pass only a datatable and not a datarow
So.we got two options now to handle this
–either clubmembers variable should be declared as DATATABLE and right side of assign Activity mentio Atlast like this
Clubmembers = names.Select (“your expression”).CopyToDatatable()
This will convert the array of datarows to a datatable
–now we can pass the clubmembers as a datatable variable to for each row loop
Or
–if you dont to want change the assign Activity and the variable type of clubmembers then we can change the loop
Use for each loop instead of for each Row loop Activity
And pass the variable clubmembers as input, but change the type argument property in for each loop as Datarow
That would work for sure
Hope this would help you buddy
Cheers @SatyaReddy

1 Like