How Do I Initialize an Empty Array of Datatables?

How do I initialize an empty array of datatables?

dtArray = New DataTable(5) {}

dtArray(0) = dtA

dtArray(5)=dtE

if you change your mind to use list which has dynamic memory allocation, below is the syntac where you need not have to specify the size.

listDT = New List(Of DataTable)

You need to use invoke method activity to Add datatables to list.

6 Likes

Or install Microsoft.Activities.extensions package and use Add To Collection activity.

2 Likes

Hi @vvaidya

I try to do the assign of New List(Of DataTable) to my DT_list and the below error appear:

Can you help me?

Ok, that’s because my DataTables_List was in Array[T] format. Had to change to collection format.

1 Like