1

I have a SQL Server connection string in a config file:

<add name="DbMaster" connectionString="Data Source=ServerName\NamedInstance;Initial Catalog=SomeDb;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>

This is fine if I am running from the domain where the SQL Server is located, but I receive the following error on a different domain:

System.Data.SqlClient.SqlException: An error has occurred 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

There is a trust between the domains.

I tried the following with no success:

<add name="DbMaster" connectionString="Data Source=ServerName.DOMAIN.COM\NamedInstance;Initial Catalog=SomeDb;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>

I can ping ServerName.DOMAIN.COM.

I have tried connecting to the SQL Server on a different domain using SQL Server Management Studio but the same error as above is received.

Is there something obvious I am doing wrong?

2
  • Have you verified that SQL Server is configured to accept remote connections as the error message indicates? Commented Dec 1, 2010 at 15:46
  • Yes, the server has been configured to accept remote connections. Commented Dec 1, 2010 at 15:48

1 Answer 1

3

If Management Studio is giving you the same error, the problem isn't with your application. The problem is with your SQL Server configuration.

Either the Trust between the Domains isn't properly configured to enable Integrated Security across domains or the SQL Server isn't properly configured to allow remote connections (like the error message states).

Integrated Security across domains is usually much more hassle than it's worth. Using SQL Server Authentication will relieve most of your headaches.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.