Monday, April 30, 2012

A network-related or instance-specific error

In previous articles i have explained  login failed for user 'sa' in sql server,.This is the common error will occur while establishing a connection to sqlserver. To resolve this problem we need to change network configuration  settings.Here i will explain how to change remote connection settings in configuration area .First we need to check the given data source name is correct or not in connection string.The TCP/IP protocol should be enable to made such type connection.The following steps will describe how to enable TCP/IP protocol in sql server configuration manager
Go To-->Configuration Tools folder which is in MS Sql Server 2008 folder in start menu
2.Select server Network configuration-->click on protocols for SQLEXPRESS.
Then we can see the protocols at Right side panel.By default the TCP/IP status is in disable mode.So we need to change status to enable


8 comments:

Anonymous said...

Thanks designed for sharing such a good thinking, article is fastidious, thats why i have read it completely
My blog post :: Rozliczanie PIT

Anonymous said...

it helped us thanks

Anonymous said...

thanks

Anonymous said...

i have deployed a web application on server but there is a runtime error i.e.

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)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: 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)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272



i have checked the connection string and database connectivity, but still these error occure.
so what should i do for resolve these error
please give me some solution as soon as posible,i have searched from 4 days.

Unknown said...

did you enable the tcp/ip properties in sql server configuaration manager?If you don't plase make the property to enable.

follow steps which is in the post.


Let meknow if you still get the problem

NEIL GARCIA said...

I have the same error in my SQL server 2008.. and I did the steps above to solve it.. but nothing was happen.. can someone help me..

Scubajunk said...

Ahhh yes thank you muchly, forgot about this step :)

Anonymous said...

Thanks! This plus changing my SQL Server to "Mixed Mode" to allow both Windows and SQL server logins fixed my problem.

Bel