Reading column A data from excel to string

i have used below code to copy excel data to string.“String.Join(Environment.NewLine,vColDT.AsEnumerable().[Select](Function(s) s.Field(of Double)(vColHeader)).ToArray())”. But column A data is reading as double so i changed it to double. it worked earlier now its not working. Getting “Specified cast is not valid”.

Thanks in advance

Hi,

Can you check if the column contains any illegal characters as Double type?

Regards,

No i checked it. Now its reading as integer and i have changed double to int32. still same issue. i have tried with “Integer” and “int32” both didn’t work. is that right format ?

Hi,

Can you try to output the following expression?
This will return data which contains illegal characters as Double type if there is.

String.Join("|", vColDT.AsEnumerable().Where(Function(r) not Double.TryParse(r(vColHeader).ToString,New Double)).Select(Function(r) r(vColHeader).ToString))

Regards,

thanks. it didn’t work. i have changed double to object. it worked.

1 Like