Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7178635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:57:37+00:00 2026-05-28T16:57:37+00:00

I use the fallowing NHibernate Mapping (NH 3.2) with MS SQL Server 2008 (set

  • 0

I use the fallowing NHibernate Mapping (NH 3.2) with MS SQL Server 2008 (set MsSql2008Dialect):

<class name="Layout" table="Layout" lazy="false"  >
    <cache usage="read-write"/>
    <id name="Id" column="Id" type="Guid">      
                    <generator class="assigned"/>
    </id>
  <version name="ObjectVersion" column="ObjectVersion"/>
    <property name="Key" column="Key" type="String" length="255" not-null="true"  />
    <property name="Value" column="Value" type="BinaryBlob" length="2147483647"  />
    <property name="Created" column="Created" type="Timestamp" not-null="true" optimistic-lock="false" />
    <property name="CreatedBy" column="CreatedBy" type="String" length="255" not-null="true" optimistic-lock="false" />
    <property name="Changed" column="Changed" type="Timestamp" optimistic-lock="false" />
    <property name="ChangedBy" column="ChangedBy" type="String" length="255" optimistic-lock="false" />
    <many-to-one  name="User" class="User" foreign-key="FK_User_Layout" lazy="proxy" fetch="select">
        <column name="UserId"/>
    </many-to-one>
</class>

The Problem is here, that for the Column Value, NHibernate will create a Field of IMAGE. But I need VarBinary(max). What is wrong with the mapping?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:57:38+00:00Added an answer on May 28, 2026 at 4:57 pm

    I have the same problem after migration from version 3.1 to 3.2.
    I think this is a bug.
    I have explored source code version 3.1 and 3.2 and have found some difference which changed initialization sequence for MsSqlDialect* classes.
    I fixed it by creating descendant of dialect class and overriding method “RegisterLargeObjectTypeMappings”

    public class MyMsSql2008Dialect : MsSql2008Dialect
    {
        protected override void RegisterLargeObjectTypeMappings()
        {
            base.RegisterLargeObjectTypeMappings();
            base.RegisterColumnType(DbType.Binary, 2147483647, "VARBINARY(MAX)");
        }
    }    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to use nhibernate on sql-server compact edition for unit testing and having some
I am trying to use Nhibernate with the Sql 2008 Geography type and am
I'm thinking about table layout for a Hibernate-managed class hierarchy, and certainly the table
I have this Fluent NHibernate mapping: public LossMap() { Table(losses); Id(x => x.Id).Column(id); References(x
I would like to use following sql to avoid constructing sql dynamically: SELECT CommentID,
Consider the following use of template template parameters... #include <iostream> template <typename X> class
I am changing my application to use Fluent NHibernate. I have created my Fluent
I have a C# WinForms application with a database backend (oracle) and use NHibernate
There is a table Item like, code,name 01,parent1 02,parent2 0101,child11 0102,child12 0201,child21 0202,child22 Create
I have a varbinary field in my sql server database that needs to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.