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 6864673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:56:28+00:00 2026-05-27T02:56:28+00:00

I have this query var hql = @from Table1 tbl1 left join fetch tbl1.Table2;

  • 0

I have this query

  var hql = @"from Table1 tbl1
                            left join fetch tbl1.Table2";

 var c =session.CreateQuery(hql).SetFirstResult(1).SetMaxResults(5)
                            .List<Table1>().ToList();

It keeps on dieing.

NHibernate.Exceptions.GenericADOException was unhandled by user code
  Message=Could not execute query[SQL: SQL not available]
  Source=NHibernate
  SqlString=SQL not available
  StackTrace:
       at NHibernate.Impl.SessionImpl.List(String query, QueryParameters queryParameters, IList results)
       at NHibernate.Impl.SessionImpl.List[T](String query, QueryParameters parameters)
       at NHibernate.Impl.QueryImpl.List[T]()
       at MvcApplication1.Controllers.Default1Controller.ThenInHql() in MvcApplication1\MvcApplication1\Controllers\Default1Controller.cs:line 152
       at MvcApplication1.Controllers.Default1Controller.Index() in MvcApplication1\MvcApplication1\Controllers\Default1Controller.cs:line 21
       at lambda_method(Closure , ControllerBase , Object[] )
       at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
       at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
       at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
  InnerException: System.ArgumentNullException
       Message=Value cannot be null.
Parameter name: source
       Source=System.Core
       ParamName=source
       StackTrace:
            at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
            at NHibernate.Engine.QueryParameters.CreateCopyUsing(RowSelection selection)
            at NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.List(ISessionImplementor session, QueryParameters queryParameters)
            at NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters queryParameters, ISessionImplementor session, IList results)
            at NHibernate.Impl.SessionImpl.List(String query, QueryParameters queryParameters, IList results)
       InnerException: 

Edit

nhibernate profiler is telling me that it is like a casting problem?

ERROR: 
The value "System.Object[]" is not of type "MvcApplication1.Models.Table1" and cannot be used in this generic collection.
Parameter name: value
  • 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-27T02:56:29+00:00Added an answer on May 27, 2026 at 2:56 am

    NHibernate ICriteria’s SetFirstResult is ZERO BASED! First Result might indicate that it starts with 1 but it doesnt. SetFirstResult(1).SetMaxResults(5) is probably not what you’re trying to do.

    change it to SetFirstResult(0).SetMaxResults(5)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an NHibernate query that looks like this: var query = Session.CreateQuery(@ select
i have this in my query: var results = (from urls in _context.Urls join
I have this query SELECT articles.*, users.username AS `user` FROM `articles` LEFT JOIN `users`
I have this query: var list = (from t1 in context1.SomeTable join t2 in
I have this LINQ query: var returnList = from TblItemEntity item in itemList join
I have this query in LINQ to Entities. var query = (from s in
I have this following IEnumerable LINQ query: var query = from p in Enumerable.Range(2,
I have this query this.FixturePartidoPuntaje.Load(); var partidos = from q in this.FixturePartidoPuntaje where (
i have this in my BlogRepository public IQueryable<Subnus.MVC.Data.Model.Post> GetPosts() { var query = from
I have a Linq query that looks something like this: var query = from

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.