X
xanthviper
Hey,
I'm trying to do what I think is pretty basic here, but I am missing
something. Hopefully someone can point me in the right direction.
Essentially I have an enumeration set up as the following:
public enum DocumentFlags
{
Enabled = 1,
Accepted = 2,
Denied = 4,
Deleted = 8,
TDB_Available = 16
};
Those values, when added up, will go into an INT field (called FLAGS)
on a SQL 2000 DB. So for instance if I work with the values of
TDB_Available and Enabled, I would put 17 within the database.
This works fine if I do my sql queries trying to match specific values
and so forth.
Unfortunately, I can't figure out how to properly determine what values
were inserted into the database field (FLAGS).
Essentially I want to, in C# on my ASP.NET project, I want to get that
17 value back, and then determine if in fact TDB_Available is within
that value?
I would love to just have a function that would basically do:
private bool IsFlagTrue(int FLAG, int CheckValue)
{
return true/false;
}
I appreciate you taking the time to check this out.
I'm trying to do what I think is pretty basic here, but I am missing
something. Hopefully someone can point me in the right direction.
Essentially I have an enumeration set up as the following:
public enum DocumentFlags
{
Enabled = 1,
Accepted = 2,
Denied = 4,
Deleted = 8,
TDB_Available = 16
};
Those values, when added up, will go into an INT field (called FLAGS)
on a SQL 2000 DB. So for instance if I work with the values of
TDB_Available and Enabled, I would put 17 within the database.
This works fine if I do my sql queries trying to match specific values
and so forth.
Unfortunately, I can't figure out how to properly determine what values
were inserted into the database field (FLAGS).
Essentially I want to, in C# on my ASP.NET project, I want to get that
17 value back, and then determine if in fact TDB_Available is within
that value?
I would love to just have a function that would basically do:
private bool IsFlagTrue(int FLAG, int CheckValue)
{
return true/false;
}
I appreciate you taking the time to check this out.