• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 557
  • Last Modified:

Operator '||' cannot be applied to operands of type

I am reciving the following error on the following code can someone please help?

ERROR:
Error  10  Operator '||' cannot be applied to operands of type 'System.Reflection.BindingFlags' and 'System.Reflection.BindingFlags'


CODE:
object newItem = itemType.InvokeMember("Copy", System.Reflection.BindingFlags.DeclaredOnly || System.Reflection.BindingFlags.Public || System.Reflection.BindingFlags.Instance || System.Reflection.BindingFlags.InvokeMethod, null, item, null);
0
wenyonk
Asked:
wenyonk
1 Solution
 
dstanley9Commented:
Try using a single | (bit-wise OR).  the || in C# is a "short-circuit" OR, meaning in only works to evaluate logical expressions.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now