Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
hi,
 
Can anyone know why this error comeing?
 
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)how to solve this error?
Posted 25-Feb-12 0:36am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

check these things
1. Make sure your database engine is configured to accept remote connections(I you are using centralized database)
•Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration
•Click on Surface Area Configuration for Services and Connections
•Select the instance that is having a problem > Database Engine > Remote Connections
•Enable local and remote connections
•Restart instance
 
2. Check the SQL Server service account
•If you are not using a domain account as a service account (for example if you are using NETWORK SERVICE), you may want to switch this first before proceeding
 
3.If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings in your ASweb P.NET application
•Usually the format needed to specify the database server is machinename\instancename
•Check your connection string as well
  Permalink  
Comments
csharpbd at 8-Nov-12 12:32pm
   
Nice solution, thanks a lot. bcz today i face this types of prob...
thanks again!
Uma Shankar Patel at 9-Nov-12 1:01am
   
Thanks
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The error is pretty explicit - and it even tells you what to do.
Check your connection string - in all probability it does not reference the SQL server instance correctly.
  Permalink  
Comments
Harpreet_125 at 7-Oct-13 7:00am
   
then how i am able to access data from the server??
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

Please go Control Panel\All Control Panel Items\Administrative Tools\services and start SQL SERVER(SQLEXPRESS).it will work.
  Permalink  
Comments
Member 2772093 at 20-Sep-13 5:18am
   
This solution worked for me. Thanks.
Member 9615112 at 31-Mar-14 9:32am
   
thanks this worked for me.
Member 10651041 at 6-Apr-14 1:58am
   
thanks!!! it works ...
Latious at 18-Apr-14 13:54pm
   
thanks it worked
bigyan sahoo at 28-Jul-14 7:23am
   
Thanks finally this solution is helpful....
M-osab at 7-Aug-14 18:49pm
   
it works thanks
Tarun Reddy at 22-Nov-14 2:40am
   
Thanks .ur solution works..
julia thomas at 2-Dec-14 23:58pm
   
thnks for ur solution..it works..
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

You can check if your computer name and the user name is same or different. if same please change the user name or computer name. u can give it a try, coz i tried all blogs, forums, Google search and lots of things for almost 1 year to solve this problem. finally i did this and it solved my problem.
  Permalink  
Comments
Sanchita Dutta at 12-Mar-13 0:19am
   
Thank you so much. It solved my problem.
Ashim Malgope at 12-Mar-13 1:33am
   
you welcome
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Try adding a , and a port number as in ",1433" to the end of your connection string.
 
Its possible that WMI or some other service dependency required to resolve the database instance name wasnt working on you local machine.
 
Manually specifying the port will resolve this.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 575
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,476
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,917


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 3 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100