nhibernate 中 报 Could not execute query[SQL: SQL not available] 错误

private static ISession _session ;
public IList<int> list()
{
using (_session = factory.Session)
{
IQuery querys
= _session.CreateQuery(“select id from news”);
return querys.List<int>();

}
}


private static ISessionFactory _factory;
static object obj = new object();
public ISession Session
{
get
{
if (_factory == null)
{
lock (obj)
{
if (_factory == null)
{
Configuration cf
= new Configuration().Configure();
_factory
= cf.BuildSessionFactory();
}
}
}
return _factory.OpenSession();
}
}
为什么这么写调用 list() 总会报错。报的是

Could not execute query[SQL: SQL not available]    在return querys.List<int>(); 中报的,本人是nhibernate新手,请指教下。

慕标琳琳
浏览 760回答 1
1回答

三国纷争

看innerException...
打开App,查看更多内容
随时随地看视频慕课网APP