Showing posts with label Nhibernate. Show all posts
Showing posts with label Nhibernate. Show all posts

NHibernate – How to use

An example, how to use Nhibernate :
  1. Add code below to your web.config file 
  2. Create session manager class as below 
  3. Call them with this code 
  4. And use them as needed, to save or delete 
Please also note below :
  • Language : C# on ASP.Net 
  • Database  : MySQL 
  • Library needed : Nhibernate, Castle Windsor, WindsorAdapter

May it helps, Thanks

Multiple database on Nhibernate

Multiple database is supported by Nhibernate.
Example below is using schema tag (bold) on hbm.xml file :


<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" auto-import="true" schema="worktracking">




Schema means = Database name
But, this method only work on the same server.

Okay, may it helps