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 (ISession session = factory.OpenSession())
{
ICriteria sc = session.CreateCriteria(typeof(Employee ));
siteList = sc.List();
session.Close();
}
factory.Close();
}