Because of some considerations I’m using an stored procedure to insert an entity in DB.
Some of my fields may have more than 4000 character length, but the query generated by NH declares some nvarchar(4000) variables to pass the value of the parameters.
Is there any way to set the length of the stored procedure parameter?
my parameter mapping is like this:
<query-param type="System.String" name="ArticleBody" />
When I set the length property in this tag like this:
<query-param type="System.String" name="ArticleBody" length="20000" />
I get this error:
“The type initializer for ‘News360.Common.Singleton`1’ threw an exception.”
Any help will be appreciated
Thanks & Regards
well the
<query-param>element only supportstypeandnameattributes.The real issue is that you are using the wrong type. In fact i think you are also declaring your types wrong. The type attribute expects the values are presented on the first column of the tables found at 5.2.2. Basic value types in the NHibernate reference.
So, use
StringClobinstead ofstring(instead of System.String).cheers