Hello, I'm a newbie to NHibernate. I tried examples projects with Console Application and it worked fine. I'm now trying to do a web application example but I've got a query problem.
In console applications, I was using session.Find() with where clause and it was workin, now I tried to use session.CreateQuery() with where clase and it doensn't work normally. It give me all the results without caring about the where clause.
This is the source code:
Code:
public void PrintEntries(DateTime date, GridView gv)
{
using (ISession session = sessionFactory.OpenSession())
using (ITransaction tx = session.BeginTransaction())
{
IQuery cq = session.CreateQuery("from Collabs as c where c.Date < :Date");
cq.SetDateTime("Date", date);
gv.DataSource = cq.List();
gv.DataBind();
tx.Commit();
}
}
Code:
agence.PrintEntries(DateTime.Parse("21 / 03 / 2006"), GridView1);
I need help please.