值不属于 Oracle 的预期范围异常

value does not fall within the expected range exception for Oracle

我在 c# 中使用 oracle 实例,当我尝试 运行 下面的代码时,我得到 value does not fall in the expected range 异常,添加更新以下声明供参考

     db.Execute(@"UPDATE DocumentLibrary 
                     SET ContentHierarchyId = :ContentHierarchyIdString,
                         IsDownloadable = :IsDownloadable,
                         IsPrintable = :IsPrintable,
                         DocumentType = :DocType
                   WHERE ObjectId = :ElementId",
                        new
                        {
                            _document.ContentHierarchyIdString,
                            _document.IsDownloadable,
                            _document.IsPrintable,
                            DocType = _document.DocumentType,
                            ElementId = _document.ObjectId.ToString()                 
                        }, transaction);

我找到了解决方法。正如我上面提到的,我使用的是 oracle,Oracle 不会直接获取布尔值,所以我更改了

      IsDownloadable = _document.IsDownloadable ? 1 : 0,
      IsPrintable = _document.IsPrintable ? 1 : 0