Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use --> OR in c#
Message
From
06/12/2006 14:33:39
John Baird
Coatesville, Pennsylvania, United States
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01175341
Message ID:
01175351
Views:
6
Your syntax is correct, I don't know why its failing.... Here is what I did and it compiled fine:
     string myNum2;
     if ((myNum2 == "C") || (myNum2 == "E"))
     {
     }
>I am trying to use a multiple OR statement in c# but am getting
>..cannot be applied to operands of type bool and type string
>
>I am trying to (in VFP code)
>if Mynum2 = "C" or MyNum2 = "E" .....
>
>My c~ code is:
>if ( (MyNum2 == "C") || (MyNum2 == "E") )
>
>and MyNum2 is declared as string.
>
>Any help appreciated.
>
>Gerard
>
Previous
Reply
Map
View

Click here to load this message in the networking platform