texudo wrote:
I use NHibernate type: BinaryBlob ; .NET Type: Byte[]
We do it exactly the same way, so I think this is not really an NHibernate issue. It propbably depends on how you fill your byte array. This is how we do it:
Code:
byte[] photo = null;
if (this.openFileDialogImage.ShowDialog() == DialogResult.OK)
{
try
{
Image img = Image.FromFile(this.openFileDialogImage.FileName);
MemoryStream ms = new MemoryStream();
img.Save(ms,ImageFormat.Jpeg);
ms.Seek(0,SeekOrigin.Begin);
photo = ms.ToArray();
}
catch
{
MsgBoxHelper.Error("Invalid image");
}
}
After which the variable photo is assigned to the property of type byte[] that is mapped as BinaryBlob. Hope this helps.