I’ve just written a new tutorial on NHibernate (an Open Source OR Mapper for .Net).

As ususal any feedback much appreciated. :)

17 Responses to “New .Net Tutorial “Introduction to NHibernate””

  1. mizan

    December 2nd, 2007 at 5:52 am

    good

    Reply
  2. Anindya Roy Chowdhury

    March 1st, 2008 at 7:00 am

    Dear Danny,
    You did a great job for the learners who are new to Nhibernate. Many many thanks for simplyflying the topics for the Novice.
    May be in future i will depend on you when i have to be introduced new technologies.
    I really pleased reading a nice topics. Keep going on. Wish you a very bright future.

    Reply
  3. Avinash Joshi

    March 11th, 2008 at 6:08 pm

    Unknown entity class: ContactDomain.Contact
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: NHibernate.MappingException: Unknown entity class: ContactDomain.Contact

    Source Error:

    Line 41: // Tell NHibernate that this object should be saved
    Line 42: //session.Save(contact);
    Line 43: session.Save(contact);
    Line 44:
    Line 45: // commit all of the changes to the DB and close the ISession

    Reply
  4. altins

    April 16th, 2008 at 10:17 am

    Hi Danny,

    Nice to know you.
    Nowadays, I am working on one my freelance project (a clinic website) and another project of mine (ebook management system). Actually, I kinda confuse to decide whether I have to use NHibernate or iBatis for both of them. Last year, I used iBatis for my previous project. But, I refer some people said that NHibernate is better and faster than iBatis.

    All I know is that iBatis can use Spring for its Business Layer, and UIP as its presentation layer.

    I try to find out if NHibernate can do the same thing like iBatis. I mean, can I use Spring for Business Prosess Layer, and if I can use Spring, then How?

    And can I also combine UIP with NHibernate? And how do I manage to do this?

    Thanks for your tutorial. And I’ll be waiting for your response.
    :) Keep Writing!

    Reply
  5. Lacuna

    May 8th, 2008 at 11:15 am

    Very good tutorial although it is a bit annoying that when copy / pasting the code (from Firefox at least) the line number translate into # symbols which you have to go through and take out. :)

    Reply
  6. DannyT

    May 8th, 2008 at 2:49 pm

    To copy click the line above the code samples that says ‘Plain Text’ This will convert the highlighted code to plain text without line numbers

    Reply
  7. mickster

    May 27th, 2008 at 6:58 am

    Very nicely done. Although I couldn’t open the solution using .NET 2005 as your example code was created with a newer version. But other than that your post stands head and shoulders above the pack. Good work. I look forward to more on NHibernate and perhaps how it integrates with Spring.NET.

    Cheers.

    Mike

    Reply
  8. mkultra

    May 29th, 2008 at 4:17 pm

    Great tutorial. As a newbie to NHibernate and .NET your walkthrough was very helpful and way more straightforward than the other examples I’ve seen.

    Thanks again!! :)

    Reply
  9. George

    June 12th, 2008 at 9:29 pm

    This is great.. .. But.. I am trying to connect with an sql server 2005 , so I would like to know if you have one of these great tutorials for that case..
    (:P)

    Reply
  10. DannyT

    June 13th, 2008 at 7:48 am

    George, this is the beauty of NH, simply change lines 13-16 of the web.config section in the tutorial to:
    <add
    key=”hibernate.dialect”
    value=”NHibernate.Dialect.MsSql2005Dialect”
    />
    and you’re done, it’s also more or less as simple to switch to mysql or oracle databases.

    Reply
  11. Mark Struzinski

    July 4th, 2008 at 3:09 am

    Danny,
    This was an awesome walk-through, and helped me get through the initial painful steps of learning NHibernate. Any plans on doing the other tutorials you mentioned at the beginning of the post to get into NHibernate in more detail? Again, thanks! This has been a great help!

    Reply
  12. Raju

    July 15th, 2008 at 1:52 pm

    This article is really helpful for me. but i need more information about this NHibernet, tell me where i can get this tutorlas.

    Thanks

    Reply
  13. Kamalesh

    August 4th, 2008 at 6:57 am

    Hi Danny,

    Nice to know you.
    This is a great tutorial. I am facing some problems in it. I use a PostgreSQLDialect connection & database connectivity was successful. I have created the required table with the fields. In Postgres i am using a sequence to generate ID. My doubt is where in the project i have to place the HBM mapping file (ie) inside Bin or AppCode, & what should be changed inside the HBM mapping for the “ID” column and my other doubt is i am not able to see the Embedded resource property anywhere in my project so that i can set the build action. rite now i am not able to generate DLL’s on runtime

    Please help !!!

    Reply
  14. pan

    October 3rd, 2009 at 4:23 pm

    Danny
    It seems the full source is not available

    Reply
  15. shri

    March 1st, 2010 at 6:45 am

    Source Code link error..file not available for download

    Reply
  16. mo

    April 29th, 2010 at 6:22 pm

    Great NHibernate tutorial, thanks. Lets have some more, cheers mate.

    Reply
  17. mont

    May 28th, 2010 at 10:01 am

    it really a nice tutorial for the beginners who want to start with nhibernate. please upload some advance tutorial on this.

    Reply

Leave a Reply

About DannyT

The blog: danny-t.co.uk - General geek talk focusing on Rich Internet Applications, Microsoft and Adobe technologies and the web in general. The business: Moov2.com - RIA development agency Dan Thomas has been an Internet geek since circa 1994. He has been running Moov2 since 2003 and prior to that worked as a Flash developer for one of europes largest E-learning providers.

Copyright © 2010 Danny-T.co.uk

CSS Template By RamblingSoul | WordPress Theme by Theme Lab and Best Hosting.