Nhibernate Exception - Return types of SQL query were not specified
- by Muhammad Akhtar
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.........