-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: error while running nhibernate application
PostPosted: Fri May 02, 2008 7:16 am 
Newbie

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.