These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Use Hibernate with SQL Server Expresss ?
PostPosted: Sat Sep 22, 2007 12:29 pm 
Newbie

Joined: Sat Sep 22, 2007 12:22 pm
Posts: 2
I want to use hibernate with attached database in C# project. But, with my hibernate.xml, it throw an Persistence Exception :

Code:
<hibernate-configuration  xmlns="urn:nhibernate-configuration-2.0" >
   <session-factory name="localfactory">
      <!-- properties -->
      <property name="hibernate.connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
      <property name="hibernate.dialect">NHibernate.Dialect.MsSql7Dialect</property>
      <property name="hibernate.connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
      <property name="hibernate.connection.connection_string">Data Source=.\\SQLEXPRESS;Database = Sample;Integrated Security=True;User Instance=True</property>
      <property name="show_sql">false</property>
      
      <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
      <!-- mapping files -->
      <mapping assembly="QT.Demo" />
   </session-factory>
</hibernate-configuration>



Can you help me ?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 22, 2007 6:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
Please post at least the exception message, if not the full stack trace.

Off the top, the schema version should be 2.2 (assuming you are using NHibernate 1.2GA):

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >

_________________
Karl Chu


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 23, 2007 12:30 am 
Newbie

Joined: Sat Sep 22, 2007 12:22 pm
Posts: 2
It run well when

Code:
<property name="hibernate.connection.connection_string">Server=localhost,1433;Database=Sample;User ID=sa;Password=$a</property>


but , I want use an attached database.

What connection string can I use ?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 23, 2007 12:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
See here:
http://www.connectionstrings.com/?carrier=sqlserver2005

_________________
Karl Chu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.