Candor.Data.DataRecordExtensions.GetBoolean C# (CSharp) Method

GetBoolean() public static method

Gets a value from a database field value or output parameter.
public static GetBoolean ( object fieldValue, bool defaultValue ) : bool
fieldValue object The value to convert.
defaultValue bool The default value if the original is DbNull.
return bool
        public static bool GetBoolean(object fieldValue, bool defaultValue)
        {
            if (fieldValue == DBNull.Value || fieldValue == null)
                return defaultValue;
            else
                return Convert.ToBoolean(fieldValue);
        }

Same methods

DataRecordExtensions::GetBoolean ( this record, string name, bool defaultValue ) : bool
DataRecordExtensions::GetBoolean ( this record, string name, bool defaultValue, bool ignoreErrors ) : bool