Assign: Cannot cast object of type 'System.Double' to type 'System.String'

Hello good
I must put the values of a column in a single cell
example:

columnA
123
457
257
897

VARIABLE={123,457,257,897}

but i get this error

Assign: Cannot cast object of type ‘System.Double’ to type ‘System.String’.

image below

Hi @GDMM ,

Could you Change the Expression to the below and Check :

String.Join(";",DtLote12Hoj2.AsEnumerable.Select(Function(a)a("Numero de factura").ToString).ToArray)

HI @GDMM

Welcome to community!

Can you tell why are converting to double?

in the meantime try this

.AsEnumerable().Select(Function(s) CDbl(s("Columname"))).ToArray

It worked for me, thanks

1 Like

Thank you so much

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