5

When I go to the 'Add New Item' window in Visual Studio 2005 and try to add a SQL Database it hangs for a bit and then give the following error:

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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

I can use SQL Server Management Studio to connection to localhost (default instance) just fine, but Visual Studio must be trying to connect to another instance (that isn't running anymore). How do I change what instance it tries to connect to in order to add and use the database?

4 Answers 4

3

It sounds like you may be trying to add an instance of an SQL Server Express database but you may not have that service installed or turned on.

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

4 Comments

I am running SQL Server 2005 Express
Max: Are you positive that the service is running?
I can connect using SQL Server Management Studio
I marked this as the answer because it is the closest to correct... I did have SQL Express running, but it has to be running with SQLExpress instance (I had changed the instance name)... it is working now.
1

Were you able to resolve this? I just spent 3 hours on the very same problem and can't say for sure what the solution was, but it works. My mistake was that the local SQL Server instance was not running when I 'upgraded' Visual Studio to the database edition. SQLExpress is not installed.

After starting the database, I initially got the same error as you when I tried to open existing database projects or create a new database project in Visual Studio. I googled it for a long time, tried all combinations of server, instance, host, alias, and other names for the design time validation database setting, all to no avail. It would not connect. I even reinstalled Visual Studio, which did not help, either.

I think what might have done the trick was a note in this msdn article - unload the project after changing this setting. I ended up clearing the field (for the default instance), unloaded the project, reloaded it, and violá, I am in business. Time to go to bed now.

Comments

0

Expand the Servers node and remove the old server.

1 Comment

In server explorer? They are the same server (my box) just different instance. How do I know what it is trying to connect to?
0

Do you get the warning dialog pointing at ... http://go.microsoft.com/fwlink/?LinkId=49251 ? My VS2005 dev machine has SQL Server Developer edition, but no SQL Express and I get that error when I try and add new SQL database

1 Comment

That link just redirects me to microsoft.com/express... But I'd assume we're getting the same error

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.