0

I'm trying to write a small app that will log into SQL Server to perform some admin functions. When I connect to SQL Server using the following connection string, I can log in fine:

Data Source=Localhost\SqlExpress;Initial Catalog=PeteDb;User Id=sa;Password=test; 

However when I want to use integrated:

Data Source=Localhost\SqlExpress;Integrated Security=True;MultipleActiveResultSets=True" 

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

How can this be solved? I am in the list of logins.

0

2 Answers 2

1

Do you need to specify the Initial catalog in the 2nd connection string? Something like this:

Data Source=Localhost\SqlExpress;Initial Catalog=PeteDb;Integrated Security=True; 
2
  • I want to log into the master db, plus it works on another machine :-( Commented Nov 2, 2011 at 21:06
  • Does the sa/test login work when you specify InitialCatalog=master? Commented Nov 2, 2011 at 21:08
0

Had the same issue setting up and instance of SQL Server. This tutorial worked for me.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.