Nhibernate - Getting Exception when run a simple join query

Posted by Muhammad Akhtar on Stack Overflow See other posts from Stack Overflow or by Muhammad Akhtar
Published on 2010-04-19T11:33:19Z Indexed on 2010/04/19 11:53 UTC
Read the original article Hit count: 246

hi, I am getting issue when I run sql Query having inner join, here is what I am doing very simple

ISession session = NHibernateHelper.GetCurrentSession();
        string query = string.Format("select Documents.TypeId from Documents inner join DocumentTrackingItems on Documents.Id = DocumentTrackingItems.DocumentId  WHERE DocumentTrackingItems.ItemStepId = {0} order by Documents.TypeId asc", 13);
        System.Collections.ArrayList document = (System.Collections.ArrayList)session.CreateSQLQuery(query, "document", typeof(Document)).List();

I am getting this exception

Exception Details: System.IndexOutOfRangeException: Id

what's wrong in my query? --- thanks

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about nhibernate