title: nhibernate varbinary(max) byte array mapping
body: <p>I looked through all the answers here and elsewhere on the web, but nothing seems to work.
  I have a table (sql server 2014) with a varbinary(max) datatype, named "Image"
  I'm using NHibernate version 3.3.1.4000, which has some fixes regarding varbinary issues.</p>
  
  <p>this is my current hibernate mapping:</p>
  
  <pre><code>   &lt;property name="Image" type="BinaryBlob"&gt;
        &lt;column name="Image" sql-type="varbinary(2147483647)" length="2147483647"/&gt;                                             
     &lt;/property&gt;
  </code></pre>
  
  <p>I also tried following variations:</p>
  
  <pre><code>&lt;property name="Image" type="BinaryBlob"/&gt;
  
  &lt;property name="Image"  length="2147483647"/&gt;
  </code></pre>
  
  <p>this is my (c# class) property:</p>
  
  <pre><code>   public virtual byte[] Image { get; set; }
  </code></pre>
  
  <p>I'm getting the familiar error:</p>
  
  <pre><code> ---&gt; System.Data.SqlClient.SqlException: String or binary data would be truncated.
  </code></pre>
  
  <p>I have a feeling the answer is staring me right in the face, but I just can't see it.
  Any help will be greatly appreciated.</p>