It's usefull, but I'm searching for a C# .net equivalent. I hope anybody can help me :-)
Main Topics
Browse All TopicsHello,
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.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I've found it:
double intGetal;
double inti;
int intJ;
double[] intGetallen = new double[3];
double intWaarde;
intGetal = 7;
intJ = 0;
for (inti = 2; inti >= 0; inti = inti - 1)
{
intWaarde = intGetal - Math.Pow(2, inti);
if (intWaarde >= 0)
{
intGetal = intGetal - Math.Pow(2, inti);
intGetallen[intJ] = Math.Pow(2, inti);
intJ = intJ + 1;
}
}
Console.WriteLine(intGetal
Console.ReadLine();
Business Accounts
Answer for Membership
by: sirahPosted on 2009-05-05 at 03:02:19ID: 24302972
please check this link, dam_machan ic/archive /2006/07/1 2/ bitmask- handling-p art-2-bitm ask-recons titution.a spx
1. http://sqlblog.com/blogs/a