is DBNull vs. DBNull.Value.Equals()
问题 I am curious what are the pros and cons of using if(some_value is DBNull) versus if(DBNull.Value.Equals(some_value)) . Personally i prefer if(some_value is DBNull) because i find it more readable. I know Microsoft recommends using if(DBNull.Value.Equals(some_value)) according to https://msdn.microsoft.com/en-us/library/system.dbnull%28v=vs.110%29.aspx. 回答1: I would go for the DBNull.Value.Equals way. Why? Beacuse is will check the type against equality. It has to look up the left hand type