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.

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.
- 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
- And How to create a DataRow like i have created DataColumn by using New Datacolumn(“EmployeeID”)
please suggest.
Regards,
Vasan.
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.