這是我的代碼NHibernate的.NET對於Oracle 10g「無法執行查詢」
我想知道想錯了嗎?
public IList listdataserviceplan(String custid)
{
using (ISession session = NHibernateHelper.OpenSession())
{
string query = 」 select a.ServicePlanId as ServicePlanId ,
a.ServiceDetail as ServiceDetail,」
+ 」 a.DateServiceFix as DateServiceFix ,a.DateService as DateService,」
+ 」 a.CaseNotSupport as CaseNotSupport ,a.ServiceChangeName as ServiceChangeName,」
+ 」 a.DateServiceNew as DateServiceNew ,a.MaterialChange as MaterialChange,」
+ 」 a.ServiceGuarantee as ServiceGuarantee ,a.ServiceMaintenance as ServiceMaintenance,」
+ 」 a.ServiceCharge as ServiceCharge」
+ 」 from BicIsu.Core.Domain.ServicePlan as a」
+ 」 where 1=1″
+ 」 and a.CustId = ‘」 + custid + 「‘ 」
+ 」 order by a.ServicePlanId」;
var cons = session.CreateQuery(query).List();
return cons;
}
}
如果您在NHibernate之外手動運行它,查詢是否可以正常工作? – 2011-01-08 03:25:34