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);
}
DataRecordExtensions::GetBoolean ( this record, string name, bool defaultValue ) : bool | |
DataRecordExtensions::GetBoolean ( this record, string name, bool defaultValue, bool ignoreErrors ) : bool |