Skip to content

connectionstring not working in nhibernate.xml #616

@listentomyblues

Description

@listentomyblues

I encountered an issue:
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: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details. )

it seems that I cannot connect to my local database which is configured in my nhibernate.xml. the same connection string is working when using other forms of connection (ADO.net, EntityFrameWork). Am I missing something here?

here is my xml file:

<?xml version='1.0' encoding='utf-8'?> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">	<session-factory>	<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>	<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>	<property name="connection.connection_string">Server=(localdb)\mssqllocaldb;Database=my_database;Trusted_Connection=True;MultipleActiveResultSets=true</property>	<property name="show_sql">true</property>	<property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>	</session-factory> </hibernate-configuration> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions