use IsNan
static function , read about it here
Your code should look like this
if(!Double.IsNaN(rs1) || rs1 != null)
NaN with NaN will always return false, this is MSDN about NaN
Two NaN values are considered unequal to one another. Therefore, it is not possible to determine whether a value is not a number by using the equality operator to compare it to another value that is equal to NaN