+ 1
Operator <= cannot be applied to operands of type ' String' and 'int'
Hi I'm not really good in coding because I'm kinda noob. Can you guys help me? I'm getting this error and can yall fix it? String txtQty = "" ; Int y = 15; If (txtQty < = y) { Message Box. Show("Inventory is low") ; }
6 Réponses
+ 1
You should not use spaces between < and =.
Valid: <=
Invalid: < =
+ 1
Sorry, I almost somehow thought you were using JavaScript. But it seems that C theSharpOne, doesn't support comparing strings and integers.
That's okay, because it would rarely give any sensible results, even in the programming languages it worked.
+ 1
Maybe you can transform the string txtQty to integer somehow.
+ 1
Ok I will try that , thanks
0
Seb TheS
I tried that but same error 😔
0
So what should I do to correct it?