Initialisation of datatable

studio

#1

Hello,

I’m working with a datatable:

dt1

doing some selection on it: dt2=dt1.select(…)

copy the result on dt3 with copytodatatable.

dt3=dt2.copytodatatable

after that i’m doing a condition on (dt3.Count.count) but:

 VisualBasicValue<Boolean> : Object référence not set to an instance of an object

#2

Hello!

You have to initialize the dt3 before copy the content from dt2.

Try something:

dt3 = dt2.Clone()

And then

dt3 = dt2.CopyToDatatable()

Hope it Helps :slight_smile:

Regards,


#3

Make sure all dataTable variables are initialized with New System.Data.DataTable

Cheers.