how do i cast object from data reader to boolean value ?
Employee has IsActive property which is Bool data type.
I tried followings but got exception .
emp.IsActive = (bool)rdr["Is_Active"];
emp.IsActive = Convert.ToBoolean(rdr["Is_Active"]);
var i = rdr.GetOrdinal("Is_Active");
emp.IsActive = rdr.GetBoolean(i);