views:

36

answers:

1

Hi

In our project user using NHibernate 2.1.1 with SQL Server 2008 with .net 3.5.

I am facing strange problem with SQL Server. We developed windows service, installed it and it was running fine for sometime. Unfortunately by mistake when I stopped SQL Server, NHibernate throw exception

System.Data.SqlClient.SqlException: 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

But after restarting the SQL Server, it is unable to connect to the SQL Server, still throwing the same error. But I am able to connect SQL Server through Query Analyzer / Management Studio.

Please any body can help me in solving the problem?

Thanks

nRk

A: 

Go to \Start Menu\Programs\Microsoft SQL Server 2008\Configuration Tools, launch SQL Server Configuration Manager and enable the connection protocols you need.

Matteo Mosca
All necessary protocols are enabled. But previously working fine, after restarting only it was giving problem... Why it was happend..?
nRk