HQL query statements such as "from entryclass", the entryclass here is not to think is the table of the database, but the name of the entity class corresponding to your map.
Database Name: Nhibernateuse NHibernategoCREATE TABLE users (LogonID nvarchar (20) NOT NULL default '0', Name nvarchar (40) default NULL, Password nvarchar (20) default NULL, EmailAddress nvarchar (40) default NULL, PRIMARY KEY (LogonID)) Go
Data table: Users
Public class entryclass {private string id; private string username; private string emaildress;
Public EntityClass () {}
Public EntityClass (String theid) {loadFromid (theid);}
Public string id {get {return id;} set {id = value;}}
Public string username {get {returname;} set {usrname = value;}}
Public string password {get {qurn password;} set {password = value;}} public} {nHibernate.cfg.configuration mcfg = new configuration (); // Create a configuration class
Mcfg.addxmlfile (System.Web.httpContext.current.server.mappath ("user.hbm.xml")); // Indicates the mapping file UserHbm.xml iSession vsession = mcfg.buildsessionFactory (). OpenSession (); // creation Session factories, generally use a single case object to encapsulate session factories.
Return vsession.createQuery (query) .list ();} If you write to from users, it is wrong.