connection to master fails, to northwind succeeds

  • Thread starter Thread starter David Thielen
  • Start date Start date
D

David Thielen

For the code:
using (IDbConnection sc = new SqlConnection(connStr))
{
sc.Open();
...

using the connection string
connStr = "Data Source=test23;Initial
Catalog=Northwind;Integrated Security=SSPI;";

it works fine

but using the connection string:
connStr = "Data Source=test23;Initial Catalog=master;Integrated
Security=SSPI;";

We have the following situation: From some computers it works, from
others we get the exception:

An error has occured while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not
open a connection to SQL Server)

Note 1: We have tried this with both SSPI and passing a username &
password.

Note 2: Some systems connect fine, others fail - but they are all
connecting to the same server so the server must be ok.

Note 3: All machines can connect to Northwind, it's master that's the
problem.

Note 4: The machines that fail do not have SqlClient listed as a
datasource in Windows.

Any ideas?

thanks - dave

david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
1. Make sure you have the right libraries running on the server (some are
turned off by default)
2. Start SQL Browser. This is more likely to be the problem with remote
connections (on another machine)

Be careful with the master database, as messing it up can bring down your
entire business.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 
Looking at it again, it looks like someone munged up the security on some of
the servers, or you are running the code locally. It is normal for the
master database to be protected. Do not have time to chase this gremlin
down, but you may have to destroy security to solve it.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 
We're seeing this with multiple servers and in every case some clients
can do this fine against every server. So we think it's a client
problem.

All we are using this for is to get all databases on the server - so
it's to do a single select.

thanks - dave


Looking at it again, it looks like someone munged up the security on some of
the servers, or you are running the code locally. It is normal for the
master database to be protected. Do not have time to chase this gremlin
down, but you may have to destroy security to solve it.


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
Hi Dave,

As for the behavior that some client can connect correctly with all the
servers while some others cannot, have you checked those thoses to see
whether there is any difference on the client-side connect protocols
configuration? Also, is the security context of the different clients
differs from each other? In addition, have you tried using sql profiler at
server-side(for those servers that suffer master database connection issue)
to see whether there is anything particular?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
As far as we can tell there is no difference in the connect protocols
but we be missing something. All of the Sql tools can connect so they
show no problems - but some of the systems do not have the Sql tools
on them - we will try that.

We think the security contexct is the same on each but Windows
security is so complex now - there is no way to tell if it's identical
on each.

What else should we look for to see why it is refused by the server?
Is there some way in the server to watch the connect request and see
if it gets it, and if so, why it's refused?

thanks - dave



Hi Dave,

As for the behavior that some client can connect correctly with all the
servers while some others cannot, have you checked those thoses to see
whether there is any difference on the client-side connect protocols
configuration? Also, is the security context of the different clients
differs from each other? In addition, have you tried using sql profiler at
server-side(for those servers that suffer master database connection issue)
to see whether there is anything particular?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
Hi Dave,

For the SQL Server side, as I mentioned in previous post, you can try using
SQL Server Profiler tool, which can log the login and query info of each
request.

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
Back
Top