Scathara1
(David Lüer)
1
Hello,
I’m trying to map several Datatable into an array of Datatable.
( Type = System.Data.Datatable )
Datatable_array(0) = Datatable_a
Datatable_array(1) = Datatable_b
… etc.
but when I run the program I get the error :
Assign: The object reference was not set to an object instance.
Can you tell me where the error is?
thanks a lot
Scathara
msan
(Michel SAN)
2
@Scathara1
You know the count of datatables
with x
as this number:
You don’t know the count
Create a List of DataTable, add each DataTable then convert ToArray if needed.
-
Initialise your list:
Datatable_list = New List(Of DataTable)
-
Either use the following code or use the AddToCollection activity:
Datatable_list.Add(Datatable_a)
Datatable_list.Add(Datatable_b)
...
-
Then convert to Array:
Datatable_array = Datatable_list.ToArray
4 Likes
Scathara1
(David Lüer)
3
Hey msan
many thanks for this very detailed and easy to understand answer
Greetings
Scathara
system
(system)
Closed
4
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.