Operator '&&' cannot be applied to operands of type 'bool' and 'string'
I ran into this error when I was creating some validation logic with an 'if' statement. It went something like this:
if (txtfield1.Text = "" || (txtfield2.Text = "" || txtfield3.Text = ""))
{
// display error message
}
You need to use double equal signs in this case.
it should be:
if (txtfield1.Text == "" || (txtfield2.Text == "" || txtfield3.Text == ""))
{
// display error message
}
Please support this blog by clicking on the sponsors to the right.
Good luck


