Wednesday, January 7, 2009

The left-hand side of an assignment must be a variable, property or indexer

The left-hand side of an assignment must be a variable, property or indexer

Assignment in conditional expression is always constant; did you mean to use == instead

The error mostly pops when a VB programmer codes in C#.

To fix this error, make sure that all operators are on the right-hand side and that the left-hand side is a variable, property, or indexer. Use == for checking values instead of ‘=’

if (String.IsNullOrEmpty(s1) == true)

instead of

if (String.IsNullOrEmpty(s1) = true)



0 comments:

kbAlertz.com :: Visual Studio 2005

kbAlertz.com :: Visual Studio 2008

kbAlertz.com :: Visual Basic 2005