0

I'm trying to do pagination on my webapp with MVC3 and nhibernate, the first page works fine but nothing else than SetFirstResult(0) works!

.SetFirstResult(request.pageIndex * request.pageSize).SetMaxResults(request.pageSize)

NHibernate.Exceptions.GenericADOException was unhandled by user code Message=could not execute query

InnerException: System.Data.SqlClient.SqlException Message=The column 'DossierN5_8_3_' was specified multiple times for 'query'.

I have searched a lot but I can't find anyone with the same problem.

3
  • The error message is telling you that you have multiple column definitions. I'd look into that.
    – ChrisF
    Nov 21, 2012 at 14:18
  • Thanks for the tip, but I dont really now how to approach that.
    – John Doe
    Nov 21, 2012 at 14:36
  • 1
    Please post your NH query, as well as the underlying model and mapping. It will help understand why you tagged as "detachedcriteria", if you use a resultTransformer, if you use eager fetching.
    – jbl
    Nov 22, 2012 at 12:06

1 Answer 1

0

I had the same problem with SetFirstResult. I found that the problem appear when I use JoinAlias.

Can't explain the reason, but after renaming alias everything is ok.

In my case problem was exactly with aliases and I guess in some cases changing join type to JoinType.LeftOuterJoin might help to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.