mmkiwi / MdbReader

.NET Library to read .mdb and .accdb files. Rewrite of MdbTools in C#
Other
5 stars 4 forks source link

Return null if IsNull property is true, but there is a value. #5

Open Alfetta159 opened 2 months ago

Alfetta159 commented 2 months ago

In MdbDataRow.cs, at line: 165, why does it return null when IsNull is true? Does IsNull have something to do with the nullability of the column? I am getting nulls back when it clearly shows a non-null Value. This happens with string values.

    /// <summary>
    /// Gets the value of the specified column in its native format.
    /// </summary>
    /// <param name="columnName">The column name</param>
    /// <returns>The underlying data object, or null if the field is null.</returns>
    /// <throws cref="ArgumentNullException"><c>columnName</c> is <c>null</c>.</throws>
    /// <throws cref="IndexOutOfRangeException"> No column with the specified name was found.</throws>
    public object? GetValue(string columnName)
    {
        var fieldValue = GetFieldValue(columnName);
        if (fieldValue.IsNull) return null;
        return fieldValue.Value;
    }