0
votes

I am using an oracle instance in c# when i am trying to run below code i am getting value does not fall within the expected range exception, adding update statement below for refrerence

     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);
1
What are the values of all of the properties you are passing in?mjwills
@mjwills _document.ContentHierarchyIdString is string,_document.IsDownloadable is boolean, _document.IsPrintable is boolean, _document.DocumentType is string, _document.ObjectId.ToString() is stringIam_NSA
What are the values?mjwills
@mjwills _document.ContentHierarchyIdString = "40673497-99b7-464c-a2cb-c5a21b6ec351", _document.IsDownloadable = false, _document.IsPrintable = false, _document.DocumentType = "May30Doc_TYPE1", _document.ObjectId.ToString() = c1f01aa4-dd61-4529-a3dd-bdf79ae15599Iam_NSA
@mjwills Found the fix...Posted below...Thank youIam_NSA

1 Answers

0
votes

I found the fix.. As i mentioned above i am using oracle, Oracle will not take Boolean value directly, so i changed

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