Re: save bit as 0 or 1not true or false



GotDotNet? wrote:
I have a bit field in my dataset that reads true or false, but i need to
save it to the db bit column as 0 or 1, how can i convert the true or false
to 0 or 1 so it saves into the table?

bool bit = true; // (or false)

int zeroOrOne = (bit) ? 1 : 0;

Save zeroOrOne to the db.

HTH,
Sven
.


Loading