Add Data Row and Add Data column clarifications

Hello,

I have attached screenshot of my current activity, Here I am trying to build a data table and passing data columns into that.

By using New DataColumn(), I am only be able to create a single column is there a code to make it as an array of columns.
Tried New DataColumn(){} error is thrown as end of expression required.

I do not want to do it by using Add datacolumn activity’s, Column array option.

Also is there a way to add a row by using New DataRow method.

Please suggest.

Regards,
Vasan.
image

1 Like

Hey @Mohan_Vasan

You can try using DataColumns.AddRange to add multiple columns at once.

Sorry, I’m unable to understand your query on adding row.

Kindly let me know.

Thanks
#nK

Hi nK,

I have attached the snap, please check.

  1. Here I am trying to add Datacolumn into the DataTable that I have built.
    And I have created a Data column by using an Assign activity with New Datacolumn(“EmployeeID”)

And the variable type is System.Data.Datacolumn

I have a requirement of adding an array of colums into the Data table.

how do I create an array of data columns, like to have a variable type of System.Data.DataColumnCollection

  1. And How to create a DataRow like i have created DataColumn by using New Datacolumn(“EmployeeID”)

please suggest.

Regards,
Vasan.

1 Like

Hey @Mohan_Vasan

Here you go…

nmnithinkrishna_DTAddColumnColRowCol.zip (2.4 KB)

I have added comments to make it clear for you in the project, If still you need any help please let me know.

Hope this helps

Thanks
#nK

Thanks nK, its really helped a lot.

1 Like

Cool @Mohan_Vasan :slight_smile:

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