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()
精彩评论