A value of type 'System.Object' cannot be set to the location with name 'Value' because it is a location of type 'System.Int32'

HI
I’m reading value from SQL database table like this.

then using GET Row Item to add received data to variable like this

Process_TrialNo is SQL database table column with Datatype INT
Value Variable varProcessTrialNo DataType is Int32

im using this to find the current value and then plus 1 into each time i run the process again.

It gives this error only when column in database has NULL value…
image

if value is 1 or 2 in database its not giving. I still want to read this as then i can know that i have to go from 0 to 1 this time…

can someone help how can i save int result into int variable?

Hi,

Can you try to use object type variable as the following?

varObj isnot Nothing AndAlso Int32.TryParse(varObj.ToString,Nothing)

varInt = Int32.Parse(varObj.ToString)

Regards,

Hi @WonderWomen,

Dont add +1 directly please use below syntax

Convert.ToInt32(varProcessTrialNo)+1

Regards,
Arivu