Joined: Thu May 01, 2008 8:01 am Posts: 3
|
My aplication is for loaing the gridview with data from database by using nhibernate and saving the data into database
while running nhibernate application iam getting the following errors:
while loading with gridview:
my code is as follows:
ISession session = NHibernateHttpModule.CurrentSession;
IQuery query = session.CreateQuery("FROM DbUser");
IList result = query.List();
GridView1.DataSource = result;
GridView1.DataBind();
my error is as follows:
in expected: <end-of-text> (possibly an invalid or unmapped class name was used in the query) [FROM DbUser]
while saving the data to database:
my code is as follows:
ISession session = NHibernateHttpModule.CurrentSession;
ITransaction transaction = session.BeginTransaction();
DbUser user = new DbUser();
user.Login = "codegod";
user.Password = "secret";
user.UserData = "vfgfhggfhgh";
session.Save(user);
transaction.Commit();
my error is as follows:
Unknown entity class: NHibernateASPSample.Domain.DbUser
session.save(user);
I tried by setting the build action=Embedded Resource in properties of DbUser.hbm.xml file.
still Iam getting the following error:
Unknown entity class: NHibernateASPSample.Domain.DbUser
session.save(user);
plz anyone can assist me, it would be greatly apreciated
Thanx
|
|