-4

cannot convert lambda expression to type bool because it is not a delegate i get the following error someone help me please,

enter image description here

Habib
  • 219,104
  • 29
  • 407
  • 436
user2123732
  • 11
  • 1
  • 2
  • 3
    You may post your code directly instead of screenshot – Habib Mar 01 '13 at 13:59
  • It is usually preferable to paste code as text rather than an image, and highlight the locations of the errors within the code using comments. – D Stanley Mar 01 '13 at 14:00

2 Answers2

7

greater than equal to is >= not =>, that is why you are getting the error.

Habib
  • 219,104
  • 29
  • 407
  • 436
  • if anyone got this error in **asp mvc view** while using `if` condition try [this](http://stackoverflow.com/a/34921576/2218697). Hope helps someone. – Shaiju T Jan 21 '16 at 10:49
5

There are several places in your code where it appears you wanted to use a comparison operator, but flipped the operators. Change

=> to >=

'=>` is the syntax C# uses to specify lamba expressions. So the order you write the operators is important.

Update

Per your comment, the variable vastus3 is not accessible outside of the do statement block. To resolve the error move the declaration up with the others:

int vastus1, vastus2, vastus3;

int vastus3 = int.Parse(tekst1);

P.Brian.Mackey
  • 43,228
  • 68
  • 238
  • 348
  • Thanks alot but got 1 error more,where i would need to add vastus3 cos i get error saying the name vastus 3 does not exist in the current context,thanks alot for help so much – user2123732 Mar 01 '13 at 14:10
  • declare vastus3 before the do loop, it's current scoped to the do loop – David Hope Mar 01 '13 at 14:13