-->
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.  [ 6 posts ] 
Author Message
 Post subject: SQL Server 2005
PostPosted: Tue Aug 01, 2006 2:09 pm 
Newbie

Joined: Tue Aug 01, 2006 1:44 pm
Posts: 2
Hibernate version: Latest

Hi !

I am trying to use nHibernate since few days now. I would like to know how to connect nHibertate (.NET 2.0) to SQL Server 2005 Express.

Also, I trying to find a good quickstart tutorial about nHibernate. Please, someone help me !

Martin


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 02, 2006 12:57 am 
Regular
Regular

Joined: Tue Feb 21, 2006 9:50 am
Posts: 107
Hi Martin,

i'm using SQL Server 2005 Developer Edition with the SqlClientDriver and MsSql2000Dialect without problems. For quickstart and tutorials see the NHibernate documentation on hibernate.org

http://www.hibernate.org/365.html

Regards
Klaus


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 02, 2006 9:58 am 
Newbie

Joined: Tue Aug 01, 2006 1:44 pm
Posts: 2
Could you please show me your App.Config? I would like to see how you get a connection from SQL Server 2005 because I am not able at all to get a connection.

Thanks !


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 03, 2006 12:35 am 
Regular
Regular

Joined: Tue Feb 21, 2006 9:50 am
Posts: 107
No problem:

Code:
<nhibernate>
   <add key="hibernate.use_reflection_optimizer" value="false" />
   <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
   <add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect" />
   <add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
   <add key="hibernate.connection.connection_string" value="Server=<your server here>;initial catalog=<your database here>;Integrated Security=false;User ID=<your user id>;Password=<your password>" />
</nhibernate>


alternative you can use "Integrated Security=SSPI" if you want to access the database with your current windows user id.

Regards
Klaus


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 03, 2006 4:27 am 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
The connection string for SQL Server 2005 Express differs from the regular SQL Server edition by allowing to specifiy the location of the mdf file.
Check out this article http://msdn2.microsoft.com/en-us/library/ms228037.aspx

HTH,
Radu


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 17, 2006 12:52 pm 
Newbie

Joined: Fri Nov 17, 2006 12:47 pm
Posts: 1
luedi wrote:
Hi Martin,
i'm using SQL Server 2005 Developer Edition with the SqlClientDriver and MsSql2000Dialect without problems.
Regards
Klaus


Are you connecting to SQL Server 2005 on localhost or remotely? I've got no problems connecting locally but as soon as I try to connect to a remote SQL Server 2005 database.

I can connect to the remote server fine through SQL Management studio, it's SQL Authentication and we're using TCP/IP, no firewall.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.