Use datatable select get datarow, however, when I add data column per array, system exception

I use datatable select get datarow, I want to add result into datarow, however, when I add data column per array, system exception

HI,

Can you check if you set DB_SumAPInvNew (not butDB_SumAPInvNewResult) at DataTable property?

And as DR_temp is DataRow array, we need to set index for it because AddDataRow can add only 1 datarow.

Regards,

HI @Lori

Can you check if the Data Table is initialized. May be DataTable is null.

Check out this thread XAML file for reference

This video link is for reference how this issue occur and solving

Regards
Gokul

Hi @Lori

You have to give a structure to db_SumAPInvNewResult so please use assign like this before for loop

Db_SumAPInvNewResult = Db_SumAPInVNew.clone()

Cheers

@Yoichi @Gokul001 @Anil_G

Thanks, I had initialized. get another error.

Hi,

For now, can you try the following expression at ArrayRow property?

DR_temp(0).ItemArray

If you need to add all items of DR_temp, we need to add ForEach activity and add all the item.

Regards,

@Yoichi
Yes, It works and only can add one row into datatable, how to get current row index? thanks.

Hi,

If need to add all the datarow, can you try either of the following?

Use ForEach

Use MergeDataTable

image

Regards,

I use for each and it works well, thanks for your great help!

1 Like

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