【发布时间】:2015-04-28 14:52:42
【问题描述】:
List<object[]> olist = null;
olist = (_session.CreateQuery("Select pc.Id as Id, " +
"pct.DescEn as DescEn,pct.DescAr as DescAr, pc.ContentEn as ContentEn," +
"pc.ContentAr as ContentAr " +
"from ProjectCharter pc,ProjectCharterTemplate pct " +
"where pct.Id=pc.PRC_PCT_ID " +
"and pc.PRC_PRJ_ID=1")
.List<object[]>())
.ToList<object[]>();
这是我的查询,我想连接两个表并获得输出, 当我运行这是数据库时,我得到了完美的答案, 但是当我通过 c# 使用 nhibernate 映射运行它时。我得到错误。
我可以这样查询还是有其他方法可以连接两个表。
提前致谢。
【问题讨论】:
-
当您使用纯 SQL 时,您希望使用 ADO.NET 而不是 nHibernate。 nHibernate 是当您不想自己编写 SQL 时。
-
@Euphoric 是的,我能够运行 IQuery 并转换为列表。
标签: c# nhibernate inner-join