Link to home
Start Free TrialLog in
Avatar of corcon
corcon

asked on

Handling bitmask values

Hello,

I'm searching for a logical syntax or method for handling following problem.

I have 3 values in bitmask format:
1 = A
2 = B
4 = C

Possible values are: 1, 2, 3, 4, 5, 6 and 7.

Now I want a kind of for-each-loop to insert the values A, B and/or C in the database.

Example 1:
Incoming value = 1
Single insert into database: A

Example 2:
Incoming value = 7
Three inserts into database: A, B and C.

What is the fastest way to do this in C# .net?

Thanks in advance.
SOLUTION
Avatar of Haris V
Haris V
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of corcon
corcon

ASKER

It's usefull, but I'm searching for a C# .net equivalent. I hope anybody can help me :-)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial