Thanks for your replies. I think I may be missing something obvious. I am 
looking for guidance on what the "suitable" types are for a varchar(max) 
column in SQL Server. The documentation (
http://nhforge.org/doc/nh/en/index.html) only mentions one clob type; 
the StringClob. This maps to the database type: DbType.String. However my 
database type is DbType.AnsiString. Can I safely use StringClob as the type 
for an AnsiString DbType? And if so is there anything else I need to 
include in the mapping file or is the following all I need to do?

<property name="MyBigAnsiColumn" type="StringClob" /> 


On Tuesday, 28 August 2012 15:46:33 UTC+10, Oskar Berggren wrote:
>
> To elaborate, if the type isn't specified in the mapping, NHibernate will 
> pick a suitable string type based on the length. But since you force the 
> type, you must force it to a suitable one for your length.
>
> /Oskar
>
>
> 2012/8/28 Fran Knebels <[email protected] <javascript:>>
>
>> You have to tell of that it is a clobtype.
>> On Aug 27, 2012 10:43 PM, "Phil Haselden" <[email protected]<javascript:>> 
>> wrote:
>>
>>> I asked a question on StackOverflow about this: 
>>> http://stackoverflow.com/questions/12105929/how-to-map-a-varcharmax-column-in-nhibernate-hbm-xml-mapping-files
>>> .
>>>
>>> A suggestion was to do the following in the hbm.xml file:
>>>
>>> <property name="MyBigAnsiColumn" type="AnsiString" length="1000000" />
>>>
>>> However when I try to save 8001 chars to that column I get a 
>>> NHibernate.PropertyValueException. If the column contains 8000 chars it 
>>> works.
>>>
>>> How do I map this type of column so that I can make use of the full size?
>>>
>>> --
>>> You received this message because you are subscribed to the Google 
>>> Groups "nhusers" group.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msg/nhusers/-/Tnv_qlnQlxUJ.
>>> To post to this group, send email to [email protected]<javascript:>
>>> .
>>> To unsubscribe from this group, send email to 
>>> [email protected] <javascript:>.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/nhusers?hl=en.
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "nhusers" group.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> To unsubscribe from this group, send email to 
>> [email protected] <javascript:>.
>> For more options, visit this group at 
>> http://groups.google.com/group/nhusers?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/GZxk26QrhlQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to