O'Reilly logo

NHibernate 3 Beginner's Guide by Gabriel N. Schenker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – Configuring NHibernate using XML

In this exercise, we are going to implement a simple application which is using NHibernate to persist data to and read data from a relational database. As a database, we will use SQLite in file mode.

  1. Open Visual Studio and create a new project. Select Console Application as the project template. Call the project XmlConfigurationSample.
  2. Due to some incompatibility issues of SQLite, we have to adjust the target framework of our application. In the Solution Explorer, right-click on the XmlConfigurationSample project and select Properties.
  3. On the Application tab, select .NET Framework 3.5 as Target framework:
  4. Switch to the Build tab and make sure that the Platform Target is set to Any CPU.
  5. Add a reference ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required