Cannot convert object '5' to type 'System.String'

In Foreach DataRow when its executes I am receiving an error for Cannot convert object ‘5’ to type ‘System.String’. There is 5 requests in my query but because of this my process breaks.

Without knowing how you get it, it’s hard to say.
Normally when you use For each data row, you get the value’s using


or by index


this will work on any type except null/Nothing/VbNull values
How are you getting the value ?
But as i write this, i can’t help thinking maybe this is error was in “Get Range” and not “Foreach data row” If you are using Get Range, you could get that error if you are using guess column type ( true by default )

With this on, it will look at first row and decide field types by the values in row one, if later rows then have a different type ( like number in some and string in others ) you will get that error. Simply set Guess column type to “false” to read all as string then.