Hey
..net 2.0
in my c# code I retrieve a value from a column in database (sql server 2000)
(using SqlReader) this database column has the datatype Bit!
Now I'm looking a way to cast this bit value into an .Net boolean variable
Boolean test = (Boolean) _SqlReader["modified"]; //this throws an
exception - specified cast is not valid!
So I was thinking maybe this could do it:
Boolean test = false;
int value = (int) _SqlReader["modified"];
if (value == 1)
test = true
I wonder if there is a much better of doing this cast?
any suggestions?