-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Pls solve thios Problem
PostPosted: Wed Jun 24, 2009 6:35 am 
Newbie

Joined: Tue Jun 23, 2009 3:07 am
Posts: 3
public static IList GetMostPopularExams(int niQueryLimit, bool bFetchFreeOSAdminRelatedOnly)
{

ISession session = DBFacade.GetCurrentSession();
IQuery query = session.CreateQuery(
"select e.Id from Exam e, TestExamination te " +
"where te.Exam = e " +
(bFetchFreeOSAdminRelatedOnly ?
" and ((upper(e.Name) like '%LINUX%') or " +
" (upper(e.Name) like '%BSD%')) " : "") +
"group by e.Id " +
"order by count(te) desc ");
query.SetMaxResults(niQueryLimit);


IList IDs = query.List(); ArrayList exams = new ArrayList();
foreach (string id in IDs)
{
exams.Add(LoadById(id));
};

return exams;
}



Server Error in '/OnlineExam' Application.
--------------------------------------------------------------------------------

in expected: e [select e.Id from Exam e, TestExamination te where te.Exam = e group by e.Id order by count(te) desc ]
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: NHibernate.QueryException: in expected: e [select e.Id from Exam e, TestExamination te where te.Exam = e group by e.Id order by count(te) desc ]

Source Error:


Line 54: {
Line 55: Log.Error("Unexpected Exception: ", ex);
Line 56: throw ex;
Line 57: };
Line 58: }


Source File: c:\OESRakesh\OES\OnlineExam\UserControl\main\leftMenu.ascx.cs Line: 56

Stack Trace:


[QueryException: in expected: e [select e.Id from Exam e, TestExamination te where te.Exam = e group by e.Id order by count(te) desc ]]
leftMenu.Page_Load(Object sender, EventArgs e) in c:\OESRakesh\OES\OnlineExam\UserControl\main\leftMenu.ascx.cs:56
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +31
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +68
System.Web.UI.Control.OnLoad(EventArgs e) +88
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +158
System.Web.UI.Control.LoadRecursive() +158
System.Web.UI.Control.LoadRecursive() +158
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3037




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42


Top
 Profile  
 
 Post subject: Re: Pls solve thios Problem
PostPosted: Wed Jun 24, 2009 8:21 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
"select e.Id from Exam e join e.TestExamination te where ...."

or if that link does not exist:

"select e.Id from TestExamination te join te.Exam e where ...."

_________________
--Wolfgang


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.