Object reference not set to an instance of an object. for array

inside my assign is
dtSummary.AsEnumerable().Select(Function (a) a.Field(of string)(“Column0”).ToString).ToArray()
i have also tried to initialize the array but still get an error.

Hi @Rowley101 ,

Could you Check if dtSummary has any rows present in it ?

Also, Do check if you have another variable of the same name.


For now, can you try the following expression?

dtSummary.AsEnumerable().Select(Function (a) if(a("Column0") is Nothing,"",a("Column0").ToString)).ToArray()


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