views:

121

answers:

3

I can neither login from my application nor connect using the wizard to my Membership Provider on my local machine. My other DBs can connect from my application just fine. My connection string is correct, it has not been changed (I was able to login using membership previously, this is a new issue).

I created a new App to see if it could be the config, threw a login on it and registered and ran into the same issue.

This is the error message I am getting: "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) "

Though my other DB can connect I still checked:

TCP/IP enabled
Multiple connections enabled
Firewall down
Correct instance of sql server being referred to in Machine config.

Also, my network service account has rights to the DB, but should there be an ASPNET user?

I can't think of a single thing I have changed to this machine since this was working previously.

Thank you. EDIT DETAILS: There are no aliases, yet, but if my other connections are working that shouldn't be the issue. I understand these things can be wonky though, so that's something I'm going to try now. Thanks. I will also try and take a look at what's going on while trying to connect. Best way: event logs? I am using Windows Auth, I'm connecting locally, using Windows 7 and SQL Server 2008 along with VS 2008. I can connect with Management Studio and query the DB, yes. NetworkService account has rights to the DB.

+1  A: 

It sounds like you can connect to one database, but not the one you need. Is that correct?

The ASPNET user is a Windows XP thing. You should generally use NETWORK SERVICE for server-based deployments.

So, you can connect from Management Studio, but not from IIS? What identity are you using for the IIS AppPool?

Can you connect if you use Cassini (the web server that comes with Visual Studio)? That should pass through your user ID.

RickNZ
Clarified a bit, thanks.
Sara Chipps
Updated my answer.
RickNZ
+1  A: 

Check the Server name in the connection-string if the Sql-Server is in the same machine with the web application use "."(dot) without quotes instead of the computer-name in your connection string.

djsolid
+1  A: 

Have you tried sniffing it to see if there's anything you can see on the wire when the connection attempt is made?

Are there any aliases around the server/DB name? Have you tried creating one and connecting to it?

Are the other instances you can connect to on the same machine? Same SQL Server instance?

If you use impersonation, does the problem go away?

andrewbadera