ORM Code on ASP.NET and SQL Server 2005

Hi, I am using ORM code in an ASP.NET application (it’s a web service) and my code runs perfectly in a console application but crashs in the Web Service.
The message is


NHibernate.HibernateException: The dialect was not set. Set the property hibernate.dialect.
   on NHibernate.Dialect.Dialect.GetDialect()
   on NHibernate.Dialect.Dialect.GetDialect(IDictionary props)
   on Orm.PersistentManager.ResolveNativeIDGenerators()
   on Orm.PersistentManager..ctor(DotNetConnectionSetting connectionSetting, SessionType sessionType)
   on Persistencia.EvalModelSystemOrmPersistentManager..ctor()
   on Persistencia.EvalModelSystemOrmPersistentManager.Instance()
   on Persistencia.ModeloFactory.LoadModeloByORMID(Int32 ID)
   on EvalModelService.CrearModeloPrueba() en d:\Visual Studio 2005\Projects\EvalModelProject\EvalModelWebService\App_Code\EvalModelService.cs:línea 63

and the simple code:

       try
        {
            bool aux = modelo.Save();            
        }
        catch (Exception ex)
        {
            ex.ToString();
        }
``` <br><a class='attachment' href='/uploads/default/original/1X/880a1a96ab48ed660b78d26fed49cc0f417981f7.rar'>EvalModelWebService.rar</a>

Hello Eduardo,

To solve the problem, please embed hibernate.cfg.xml in the assembly.

Best regards,
Jick

THANNNKKKKK YOUUUUUUUUUUU!!!
The problem is solved!! :smiley:

Thanks!

Please could you help me with a similar problem.

I have a file called NHibernate.xml which I assume is the cfg file to which you refer. How do I ’ embed hibernate.cfg.xml in the assembly’.

Currently I get I get…

Server Error in ‘/VSC’ Application.

The dialect was not set. Set the property hibernate.dialect.
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.HibernateException: The dialect was not set. Set the property hibernate.dialect.

Source Error:

etc etc…

OK!!

1º) Add an existing item… the file “hibernate.cfg.xml” to your project.

2º) Click right button over the item “hibernate.cfg.xml” in the tree project.

3º) Select “Properties”

4º) And select “Embeded resource” in “Action generation”.

5º) You can compile your project and add the .dll file to another project.

(Sorry for my english)
Captura1.JPG
Captura2.JPG