开发者

Object reference not set to an instance of an object Error

I'm trying to save text fields in MySql using NHibernate in Asp.Net frame work. But while executing this I got the error"Object reference not set to an instance of an object". If anyone knew help me...

Here is the code.

if (!Page.IsPostBack) 
{
   IList siteList; 
   ISessionFactory factory = new NHibernate.Cfg.Configuration().Configure().BuildSessionFactory(); 
   using (ISessi开发者_高级运维on session = factory.OpenSession()) 
   {
      ICriteria sc = session.CreateCriteria(typeof(Employee )); 
      siteList = sc.List(); 
      session.Close(); 
   } 
   factory.Close(); 
}


**Can you post a stack trace? And a description of how you are configuring **

If i had to take a guess the crash is in (because of missing/incorrect configuration information):

new NHibernate.Cfg.Configuration().Configure().Build().SessionFactory()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜