Invalid Cast Exception message

Could anyone provide some insight on this message?

It appears to me that the exception was thrown due to an attempt to read an empty string as binary data.

This occurred within a section of code containing an aggregate that is reading from doclib.attachement not writing to it!


System.InvalidCastException: Could not assign '' to 'doclib.attachment'... Thread was being aborted.
   at OutSystems.HubEdition.RuntimePlatform.DataReaderUtils.#mqb[#5](IDataReader reader, Int32 i, String columnName, Func`4 convertFunction)
   at OutSystems.HubEdition.RuntimePlatform.DataReaderUtils.ReadBinaryData(IDataReader reader, Int32 i, String columnName, Byte[] defaultValue)
   at ssResumeStorageCore.ENdoclibEntityRecord.Read(IDataReader r, Int32& index)
   at ssResumeStorageCore.Actions.FuncActionGetHistoricalApplicants.datasetGetPerdocsReadDB(RCperdocdoclibRecord& rec, IDataReader r)
   at OutSystems.HubEdition.RuntimePlatform.Db.GenericRecordList`1.Read()
   at OutSystems.HubEdition.RuntimePlatform.Db.OSList`1.Advance()
   at ssResumeStorageCore.Actions.ActionGetHistoricalApplicants(HeContext heContext, RLResumeStorageRequestList& outParamResumeListForStorage)
   at ssResumeStorageCore.Actions.ActionHistoricalParse(HeContext heContext)
   at ssResumeStorageCore.TimerHistoricalParse.Execute(HeContext heContext, Int32 timeout)

David,


I think you would need to provide a good bit more context. The best get is it's trying to read something that is expecting data in a binary field and its either empty of some non-expected data.  Try looking at the data outside the platform for anomolies


Hi,

One of the columns has a value that the platform couldn't cast to the expected output you have.

Try to check directly in the database, if you can to see if there's a record with strange values in one of the columns.