NHibernate is not connecting to sql server.

Posted by user177883 on Stack Overflow See other posts from Stack Overflow or by user177883
Published on 2010-03-24T14:04:20Z Indexed on 2010/03/24 14:43 UTC
Read the original article Hit count: 238

Filed under:
|
|
|
|

When i set up a regular connection, it works, however when i try to use nhibernate, hibernate.cfg.xml, i m getting the following error.

Message="A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)" Source=".Net SqlClient Data Provider"

What would be the reason for this and how can i resolve it ?

I doubt that it s a network or sql server configuration error.

<?xml version="1.0" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
  <session-factory>
    <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
    <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
    <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
    <property name="connection.connection_string">Server=(ServerName\DEV_ENV);Initial Catalog=dbName;User Id=SA;Password=PASS</property>

    <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>

  </session-factory>
</hibernate-configuration>

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET