Visual Paradigm Logo
     Build Quality Applications Faster, Better and Cheaper
 
Home | Products | Download | Documentation | Support | Resources | Partners | Quick Tour | Shop | Company |  
 
   Visual Paradigm Discussion Forum
  Login   [ Register ] Email: Password: Log me on automatically I lost my password  
Advanced Search
ORM Code on ASP.NET and SQL Server 2005  
Forum Index -> Object Relational Mapping (ORM)
Author Message
Eduardo




Joined: 2007/04/17
Messages: 9

Location: Spain
Offline

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

Code:
 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:

Code:
       try
         {
             bool aux = modelo.Save();            
         }
         catch (Exception ex)
         {
             ex.ToString();
         }

EvalModelWebService.rar
 Description EvalModelWebService and NHibernate for Sql Server 2005 Download
 Filesize 353 kb
 Downloaded:  204 time(s)

 
Jick


Joined: 2005/04/29
Messages: 2881

Offline

Hello Eduardo,

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

Best regards,
Jick

Visual Paradigm International Ltd.
http://www.visual-paradigm.com

Build Quality Applications Faster, Better and Cheaper
 
Eduardo




Joined: 2007/04/17
Messages: 9

Location: Spain
Offline

THANNNKKKKK YOUUUUUUUUUUU!!!!!
The problem is solved!!

Thanks!
 
Anonymous

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................

 
Eduardo




Joined: 2007/04/17
Messages: 9

Location: Spain
Offline

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)

Attached Image : No description given (42 kb)

Attached Image : No description given (22 kb)

 
 
   Forum Index -> Object Relational Mapping (ORM)
Go to:   
Powered by JForum 2.1.4 © 2005 - Rafael Steil