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


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.


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


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