LCKB
[C#] ForEach loop with Object - Printable Version

+- LCKB (https://lckb.dev/forum)
+-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109)
+--- Forum: Programmers Gateway (https://lckb.dev/forum/forumdisplay.php?fid=196)
+---- Forum: Coders Talk (https://lckb.dev/forum/forumdisplay.php?fid=192)
+---- Thread: [C#] ForEach loop with Object (/showthread.php?tid=199)



- Nikolee - 10-30-2012


// Fixxed..

This problem left:

for (int y = 0; y < klasse.UserID; y++)
{

}

 

Error is : the operator "<" can not be applied to operands of type 'int' and 'object'




- Wizatek - 10-30-2012


Maybe klasse.UserID is a object?

try with casting it

 

for(int y=0; y




- Nikolee - 10-30-2012


the userID is an object because of the mysql result^^

 

casting dont work too this error appears: Object reference not set to an instance of an object.