Syntax of an Array of (Data.Tables)

Hey guys, I have to read a lot of .csv-files and want to save them all into an array of datatables,

but I don’t know the syntax for defining the length of the array, thought is something like:
[{“table1row1”}{“table1row2”}],[{“table2row1”}{“table2row2”}],…

So how can I define the length of an array of (data.table) and how is the syntax of it?

I hope you can understand my problem and question.
The datatables in the array are filled with strings only by the way.

1 Like

Hi
its like this
New Datatable(10){}
so the variable name is dt_array
variable type is Array(system.Data.Datatable) (we can get that in the variable panel on choosing array as type and while choosing the type of T search as System.Data.Datatable)
then the default value be like New Datatable(10){} //where 10 denotes the length of the array

like this @Lorenz_Goring

Cheers @Lorenz_Goring

1 Like

The syntax to declare a array of type string is new String(rowCount){} @Lorenz_Goring

And if you want the array of datatable, the same way new DataTable(rowCount){}

The rowcount is the number of datatables you have. If you want to assign the rowCount with a specific data table rows , then

datatable.Rows.Count will give you the number of rows in that one datatable and you can assign it directly in the length

1 Like

Ouh wow, i didn’t think its that easy, thank you alot!

1 Like

No worries :slight_smile:
Cheers @Lorenz_Goring

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