Option strict on prohibits operands of type object for operator "+"


#1

hi all, when i use for each row with if condition like: row(“平台金额(元)”)=row (“用户在线支付交易金额(元)”)+row(“平台承担费用(元)”)-row(“平台佣金(元)”), it turns out an error: option strict on prohibits operands of type object for operator ‘+’. does any body know what’s the meaning of this and how to solve it? many thanks!


#2

You can try Convert.{yourTypeHere}(row(column)) + .... to signify to compiler what type it should be treated as (by default it’s Object and you cannot add or substract objects).
From how it looks, these are numbers stored there? Then you’ll either want Int32, Double or Decimal as the type.


#3

@andrzej.kniola
yes!it’s numbers, this helps, btw, how to mark this as solution, i clicked the solution button below your answer by mistake and it disappear and i could not find it anymore, sorry.