Note that there are some explanatory texts on larger screens.

plurals
  1. POFluent NHibernate issue with nvarchar(max) and sql express 2005
    text
    copied!<p>I have recently updated from NH2.1 to the latest trunk build. I also upgraded to the latest source code of Fluent NHibernate.</p> <p>A new issue has been introduced which manifests as the following exception :</p> <pre><code>System.Data.SqlClient.SqlException: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 3 ("@p0"): Data type 0xE7 has an invalid data length or metadata length. </code></pre> <p>My fluent mappings produce the following hbm xml :</p> <pre><code>&lt;property name="FirstName" type="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&gt; &lt;column name="FirstName" length="4001" /&gt; &lt;/property&gt; </code></pre> <p><strong><em>The problem goes away</em></strong> if I use 'ntext' to produce the following mapping :</p> <pre><code>&lt;property name="FirstName" type="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&gt; &lt;column name="FirstName" sql-type="NTEXT" /&gt; &lt;/property&gt; </code></pre> <p>To be honest I am unsure who/what is responsible for the issue. My instinct suggests that it is NHibernate itself, and I was able to isolate the issue to that particular property mapping (in actuality there are multiple max strings in the entity being mapped).</p> <p>For further complexity, the problem <strong><em>does not</em></strong> show when using Sqlite, so my guess is the issue may be buried in the dialect.</p> <p><em>(I want to establish what is causing the issue before I post to the relevant user group)</em></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload