-->
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.  [ 3 posts ] 
Author Message
 Post subject: Error on connection to SQL Server 2005 Express
PostPosted: Thu May 04, 2006 8:30 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi all,

I´m trying to use the SQL Server 2005 Express Edtion, but the
following error occurs:

Code:
Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


The database is in local machine, to test the version 2005.
I configured the Local database in "SQL Server Surface Area Configuration"
to allow remote connections by using TCP/IP and Named Pipes,
but the above error occurs yet.

Is there a way to connect to SQL Server 2005 Express by using
NHibernate?

thank u very much!!!!

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 9:58 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
I solved the problem puting the Data Source with machine\sqlexpress like this:

Code:
  <nhibernate>
    <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="Data Source=MACHINE_NAME\SQLEXPRESS;Database=basdb;User ID=acc;Password=pwd123;"/>
    <add key="hibernate.connection.isolation" value="ReadCommitted"/>
    <add key="hibernate.default_schema" value="basdb.dbo"/>
    <add key="hibernate.show_sql" value="true"/>
  </nhibernate>


_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 11:37 am 
Newbie

Joined: Thu May 04, 2006 5:51 am
Posts: 7
You might find that .\SQLEXPRESS also works (and without problems when you go to another machine).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.