473,804 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NHibernate application configuration.. .

The documents on their website are completely wrong. Following is the a
real example that works with NHibernate 1.0.2.0:

<?xml version="1.0" encoding="utf-8"?>
<configuratio n
xmlns="http://schemas.microso ft.com/.NetConfigurati on/v2.0">
<configSections >
<!-- SecurityExcepti on is thrown if NHibernate assembly is not in
GAC. -->
<section name="hibernate-configuration"
type="NHibernat e.Cfg.Configura tionSectionHand ler"/>
</configSections>
<!-- NHibernate configuration:
---- xmlns="urn:nhib ernate-configuration-2.0" must be present to pass
validation.
-->
<hibernate-configuration xmlns="urn:nhib ernate-configuration-2.0">
<session-factory>
<!-- Database Settings -->
<property
name="hibernate .connection.pro vider">NHiberna te.Connection.D riverConnection Provider</property>
<property
name="hibernate .connection.dri ver_class">NHib ernate.Driver.S qlClientDriver</property>
<property
name="hibernate .connection.con nection_string" >Server=(local) ;Database=myDB; User
ID=myName;Passw ord=myPassword</property>
<property
name="hibernate .dialect">NHibe rnate.Dialect.M sSql2000Dialect </property>
<!-- Transaction Settings -->
<property
name="hibernate .connection.iso lation">ReadCom mitted</property>
<!-- [optional] specify default schema, for improving performance
-->
<property name="hibernate .default_schema ">myDB.dbo</property>
<!-- Display SQL (useless for .NET?) -->
<property name="hibernate .format_sql">tr ue</property>
<property name="hibernate .show_sql">true </property>
</session-factory>
</hibernate-configuration>
......

NHibernate.dll *must* be added into GAC before you can use the section
handler in .config.
Cheers!

Mar 18 '06 #1
0 2862

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3322
by: Pierre | last post by:
Hi, In my C# project (VisitorManagement) I have a subfolder (BusinessObjects) in which I have put the objects needed for NHibernate and the mapping files. In the top of my web service I do a using VisitorManagement.BusinessObjects; and I'm able to use these objects. But When I invoke the web service I get the following error.
1
13712
by: erin.sebastian | last post by:
Hello All, I am new to hibernate and new to nHibernate. I created a small app and when i try and run it i get the error i posted at the bottom of this message. I am using the helper class that can be found here http://blogs.intesoft.net/simon/articles/16.aspx#36 . Does anyone know why this error might occur.. i have NO IDEA.... if you require anymore information please let me know and i will send it through. Thanks in advance! Erin
5
9573
by: gaddoz | last post by:
Hi all, I'm trying to set up a .NET webservice using in data access layer Nhibernate (nhib 1.2.0 beta). The first trouble I met was that a webservice cannot serialize Interfaces, like IList<>. After I workarounded it, now I get: System.InvalidOperationException: There was an error generating the XML
0
1795
by: TigrouMeow | last post by:
Hello, I'm trying to make a "clean" webservice, using Nhibernate. I'm facing some issues, but i'm quite the beginner with that kind of system. When there are more than 2 clients connected on my webservice, i get errors. It seems that the connection is dropped. Here is what i get in theWinforms application using the Webservice : Error = {"The underlying connection was closed: An unexpected error occurred on a receive."}
0
4889
by: beantaxi | last post by:
Hello all, I'm trying to write a simple program, using VS C# 2005 Express and SQL Server Express with NHib 1.0.2. No matter what I try, I'm unable to connect: cannot open connection at NHibernate.Impl.SessionFactoryImpl.OpenConnection() at NHibernate.Impl.SessionImpl.get_Connection() at NHibernate.Transaction.AdoTransaction.Begin(IsolationLevel
4
3337
by: IceMan | last post by:
Hi, I am using the configuration object and passing it a Assembly object to load. The assembly object i pass in is from a dll which is in a different folder then the Nhibernate dll. The AddAssembly(Assembly assembly) function throws me an Error saying it can't load the configuration hbm.xml file because it can't load the assembly in the hbm.xml file. Why does NHibernate try to load the Assembly again??
0
6308
by: Jacques Vandensavel | last post by:
I have a legacy table which is composed out three key fields. It is representing a bank. I'm using NHibernate in my ASP.NET application to glue everything together. I'm already searching for an answer the last couple of weeks, but to no aval. The table layout is: * customer id * bank name * bank account no status
14
3692
by: thj | last post by:
Hi, I was wondering what you guys are using and why? LINQ to SQL or NHibernate? Thanks in advance, Tommy
1
2264
by: moorcroft | last post by:
Hi I'm looking for help with getting the latest NHibernate to work with my .Net 3.5 VS 2008 project that I am migrating from .Net 2.0 on VS 2005. Previously (VS 2005 .Net 2.0) I would use the folling lines to query the database: ICriteria criteria = mSession.CreateCriteria(typeof(Application)); criteria.Add(new EqExpression("ReferenceNumber", "2008/0128/NEW", true)); BCApplication application = (Application)criteria.UniqueResult(); This...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10354
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.