If you are sure that the column values will never be NULL, then the following will do the trick:
bool active = rdr.GetBoolean(rdr.GetOrdinal("Active"));
If it is possible that values NULLcan be returned:
int oActive = rdr.GetOrdinal("Active");
bool? active = rdr.IsDBNull(oActive) ? (bool?)null : rdr.GetBoolean(oActive);
Lukeh source
share