I'm having trouble displaying our byte[] field. I have been looking for several solutions, but not working yet. All I get is an exception:
The length of the byte[] value exceeds the length configured in the mapping/parameter.
Below is what I still have in hbm.xml
<property name="Data" type="BinaryBlob"> <column name="attachmentData" sql-type="varbinary(max)"/> </property>
Am I doing something wrong?
Update - Solution:
It turned out that I did it wrong. We insert byte[] through the stored procedure , so the mapping of properties has nothing to do with this. Instead, we need to specify the NHibernate sprocs parameter type as follows:
query.SetParameter(param.Key, param.Value, NHibernateUtil.BinaryBlob);
source share