How Do I Initialize an Empty Array of Datatables?


#1

How do I initialize an empty array of datatables?


#2

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.


#3

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


#4

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?


#5

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


#6