Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
if (SettingManger.Instance.User != "deepakp")  || ( if (SettingManger.Instance.User != "ravis");
Posted
Updated 2-Jan-13 23:47pm
v5
Comments
Master Vinu 3-Jan-13 5:37am    
if (SettingManger.Instance.User != "deepakp" ||"ravi") not working

Moreover, I think here you need an AND operator rather than an OR one.

Thus:

C#
if ((SettingManger.Instance.User != "deepakp") && (SettingManger.Instance.User != "ravis"))
{
   // Your Code
}
 
Share this answer
 
Comments
fjdiewornncalwe 3-Jan-13 10:45am    
+5. Glad you saw the real problem here.
phil.o 5-Jan-13 13:39pm    
Thanks :)
[no name] 3-Jan-13 10:56am    
thanks marcus.....:-)
if ((SettingManger.Instance.User != "deepakp") || (SettingManger.Instance.User != "ravis"))
{
// Your Code
}
 
Share this answer
 
Comments
Master Vinu 3-Jan-13 5:39am    
i want enable textbox for this user
if ((SettingManger.Instance.User != "deepakp") || (SettingManger.Instance.User != "ravis"))
{
textbox1.Enabled
}
fjdiewornncalwe 3-Jan-13 10:45am    
My 1. This if will ALWAYS fall through with true. The problem is that the OP needs to use &&, not ||.
[no name] 7-Jan-13 9:47am    
@Marcus Kramer : Read question carefully .....vc asked for "OR" Operator use..........
C#
if ( X || Y ) { ...

The word 'if' appears only once.

Hope this helps,
Pablo.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900