Hi Fred,
Try this:
if (x == 1 || x == 2)
{
}
else
{
}
The || means OR ... if you want AND, use &&. You must use == (one = means assignment).
Also, if you only have one statement following the if or the else, you don't have to use the curly brackets.
HTH,
~~Bonnie
>Hi guys,
>I need some basic help
>
>in VFP we can use the foll if statement
>if x=1 or x = 2
> do something
>else
> do something else
>endif
>
>how can I do this in C# ?
>
>Regards