How to use Add Data Row activity?

Hallo,

I want to add a row to an existing DataTable. The value I want to add is in this variable: “dtList.Rows(i)(10).ToString”. i being the rowindex. The Datatable dtList I want has 3 colums. I want to add a new row in colum 0 (“Name”).

thanks

1 Like

Hi.
You can use “Add Data Row” activity itself. In the properties of the activity you can see ArrayRow. In that, specify the values in the below format:
{dtList.Rows(i)(10).ToString,“”,“”}
Specify the Datatatable name also.

2 Likes

Hi, can I also use DataRow instead of ArrayRow ?

thank you for your help

  1. declare new DataRow variable e.g. “newRow”
  2. initialize “newRow” to be a new row of your datatable by assining dt.NewRow to “newRow” variable
  3. assign values to newRow variable e.g. newRow(“Name”) = “test”
  4. after all the values are assigned, use “Add Data Row” activity, fill in dataRow and dataTable properties. (Note - you can use ArrayRow property by passing in newRow.ItemArray)
4 Likes

see my reply

thank you very much!

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