Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Could not open a connection to SQL Server

Author  Topic 

dolphin123
Yak Posting Veteran

84 Posts

Posted - 2012-07-12 : 12:56:38
Hello,

I have fixed this error a million times as my job as a Junior DBA/network admin. But, this time It has already taken me 6 hours but no luck. Same error - provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL server).

It is a .Net application. Working fine in the Production site but not in a Staging environment. The Application are of the same version.

1. Under SQL server network configuration Names Pipes, TCP/IP and shared memory are enabled.
2. The User ID permissions are same for both Production and Staging.
3. I can go the application server, create a .udl file to test the connection string and it connects to the database. So, I don't think it is a firewall issue.

Is there any thing else I can should be looking at. Any help is greatly appreciated.

Thanks a lot for your time.

- D

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-07-12 : 13:21:04
Try connecting to the database server via ServerName,PortNumber. If that works, then you can add an alias so you don't have to specify the port number.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

dolphin123
Yak Posting Veteran

84 Posts

Posted - 2012-07-12 : 13:56:58
Thank you Tara for replying.

But I tried creating a .udl file on the application server and I was able to test the connection without using the port. Doesn't that mean that app should work without the port number as well?

Please check the following screenshot from the app server. It is the UDL file test.

http://screencast.com/t/wMXGKEf9kA

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-07-12 : 13:59:46
Please try connecting with the port as I suggested and let me know. Ignore the UDL for now.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

dolphin123
Yak Posting Veteran

84 Posts

Posted - 2012-07-12 : 14:57:28
Hi Tara,

No luck. I changed the 4 connection strings used by the application to be added to 1433, but still does not connect.

Data Source=172.16.14.200,1433;Initial Catalog=DB;user id=blahU;pwd=blahP

:(

Thanks for your time.

- D

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-07-12 : 15:15:58
Are you sure the instance is using port 1433? Does 172.16.14.200,1433 work in the UDL?

Are their SQL client tools installed on this server where you can test things via Management Studio or even sqlcmd.exe?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

dolphin123
Yak Posting Veteran

84 Posts

Posted - 2012-07-13 : 10:54:21
Thanks a lot Tara. I found the issue is.
The connection strings are stored in tables. I had no idea that the Application custom services have to be restarted when I change the connection strings are changed. It is all good now. It is connecting.

I appreciate your time a lot. Thank you
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-07-13 : 11:03:06


Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -