Datarow: cannot assign object to datarow

Hi guys I am trying to implement an add data row activity.
So right now I want to add a data row to a table, nested inside a for each row activity in another data table. the itme to loop through is called “CurrentRow”.


image

I have assigned “CompositeMvmPN” with DataRow variable type, how can I assign the value of CompositeMvmPN with the currentrow of another datatable, which is being looped through? Thanks! Also, do I need to build the CompositeMvm table before the loop? Thanks!

yes you need to build,Can you explain in detail…
Thanks

1 Like

Hi @Hou_Paang_Soul ,
You can try with System.String[][]

Regards,
LNV

1 Like

First build a datatable using “build datatable” activity
Then add data row

If you want to loop through a datatable you can use “for each row in datatable” and inside that use add data row activity

Regards,

1 Like

Hey @Hou_Paang_Soul ,

U have error in your assign activity, can you please check the datatype of ComposieMvmPN in the variable panel.

The variable datatype of ComposieMvmPN should be System.Data.DataRow
image

Hope it helps you out!

1 Like

@Hou_Paang_Soul

Your compositemympn is of type datarow I believe

If so in assign on right side you just need to give currentrow

Also if you pass to direct datarow it might throw error

Instead pass it like this

Currentrow.ItemArray or CompositeMyMPN.ItemArray in the array row field of add data row that would work

Hope this helps

Cheers

1 Like

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