Nhibernate Exception - Return types of SQL query were not specified

Posted by Muhammad Akhtar on Stack Overflow See other posts from Stack Overflow or by Muhammad Akhtar
Published on 2010-04-20T10:50:51Z Indexed on 2010/04/20 10:53 UTC
Read the original article Hit count: 280

Filed under:
|
|
|
|

I am executing SQL in hibernate and getting exception Return types of SQL query were not specified

public ArrayList get(string Release, int DocId)
{
    string query = string.Format("select ti.Id, ('  Defect ' + cast(ti.onTimeId as varchar) + ' -  ' + ti.Name) as Name from TrackingItems ti inner join DocumentTrackingItems dti on ti.Id = dti.ItemStepId inner join Documents doc on dti.DocumentId = doc.Id where ti.ReleaseId = '{0}' AND doc.TypeId = {1} and Doc.Name is null AND ti.Type = 'Defect'", Release, DocId);
    ISession session = NHibernateHelper.GetCurrentSession();
    ArrayList arList = (ArrayList)session.CreateSQLQuery(query).List();
    return arList;
}

When I run this query in SQL, it working fine.

any idea what could be the issue? -------- Thanks.........

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about nhibernate