0

So, I am using Visual Studio 2010 and was trying to create a new database that I could use in my project. I have vague idea of having used the Server Explorer in the past, although I'm not that sure about it. My experience with MSSQL is almost non-existent, anyway.

I don't remember having to configure anything, but it seems I have a server called Xyz already set up, as can be seen in the next picture:

enter image description here

I've tried to to create a new database, but I am getting the following error:

enter image description here

What might be wrong? What tools should I make sure are correctly running? Isn't there something like Oracle's Sql Developer which allows me easily to inspect what's happening with my databases?

Also, what about the authentication? I can't recall having configured anything when installing Visual Studio. Maybe I still have to configure something?

enter image description here

I'm quite lost here, I'd appreciate some light shed up on me on this issue. Thanks!

devoured elysium
  • 101,373
  • 131
  • 340
  • 557
  • Hi this can be solved easily here I have give you link with proper graphics and image just refere it http://sqldebate.blogspot.com/2012/01/how-to-connect-sql-server-with-visual.html –  Jan 24 '12 at 13:52
  • might be related: https://stackoverflow.com/questions/9945409/how-do-i-fix-the-error-named-pipes-provider-error-40-could-not-open-a-connec – XoXo Sep 23 '19 at 18:11

3 Answers3

1

Sounds like you don't have a SQL server or you're lacking some permissions.

Mrchief
  • 75,126
  • 20
  • 142
  • 189
1

On the server go Start->Run and type in services.msc and look to see if you have the SQL Server process and it is running. Also verify it is not a named instance. If you see "SQL Server (MSSQLSERVER)" it is a default instance and you should be able to reference it using the server name. If you see "SQL Server (SomethingElse)" you have to reference it using servername\SomethingElse

You also need to verify you have named pipes enabled by running the SQL Server Configuration Manager -> SQL Server Network Configuration -> Client Protocols.

If the sql server is new, it is probably because named pipes isn't enabled.

Or it could be like Mrchief stated and you don't have permissions to access that server.

Actually I think you would get a permissions error if that was the case. Your error is specific to connecting to the sql box.

Joshua Dale
  • 1,773
  • 3
  • 17
  • 25
1

I had similar problem with the same set up. This article helped: http://support.microsoft.com/kb/823938

It turns out that SQL Server 2008 is shipped with TSP/IP disabled by default and nobody can connect to it via network, even from localhost. Here is the solution:

You can check in registry this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLServer\SuperSocketNetLib\Tcp\Enabled
It must be set to 1 for SQL Server to be listening for network connection. If it is set to 0, change it to 1 and restart SQLSERVER service.

Run this on master database to see error log on the server:
exec Go Xp_readerrorlog
You should look for SQL server listening on X.X.X.X: Y This will be an indicator if network connections are allowed in the Server

trailmax
  • 34,305
  • 22
  • 140
  • 234
  • Just create Enabled key and set it to 1, see what happens. I've added keys in registry for other software and it worked. It would not do any harm anyway. – trailmax Jul 01 '11 at 23:29
  • Doesn't seem to do a thing. I was thinking of formatting my computer one of these days. Making a fresh Visual Studio 2010 installation would solve the issue? – devoured elysium Jul 01 '11 at 23:40
  • I don't think this is the problem with Visual Studio. Sounds like a problem with SQL Server installation. I made up a little script to test connection to SQL Server ( http://dl.dropbox.com/u/12309371/mssql_connectionTester.vbs ). Just run it "cscript mssql_connectionTester.vbs" from command line. It will tell you if the connection to SQL Server is possible at all. Script is harmless - just check it -) Obviously you'll need to change connection details (username and password) – trailmax Jul 02 '11 at 00:10
  • Error : Server does not exist or access is denied. I'm going to format my computer, then. – devoured elysium Jul 02 '11 at 02:16