I'll go straight to the issue. I was using the membership feature a while ago and I was ok and didn't have any problems. I had to reinstall the whole windows for some reasons, and also reinstalled the visual studio and sql server among with that. Now I'm trying to connect to the membership database: I have a Create User Wizard control and I'm trying to create a new account. That simple. but I get 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
This error is also displayed when I try to login to an account, although it doesn't e开发者_如何转开发xist!
I've also tried to install the databases manually using regsql tool and this script: aspnet_regsql -S (local) -E -A all
Well, I get the same error again (error 40)
About the version, I guess I'm using Sql Server 2008 Express. I got the following output when I executed this query: "SELECT @@version"
Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (Intel X86) Mar 29 2009 10:27:29 Copyright (c) 1988-2008 Microsoft Corporation Express Edition on Windows NT 6.1 (Build 7600: ) I didn't find any answer for this situation. Can anyone help me?
Here's an incredibly long page on documenting this error: http://blogs.msdn.com/b/sql_protocols/archive/2005/10/22/483684.aspx
But, try these things first before drudging through that, as it's typically caused by a few common things:
- Enable the TCP/IP protocol using the Surface Area Configuration Utility
- Make sure the TCP/IP protocol is enabled in the SQL Server Configuration Utility
- Make sure the SQL Server browser is started.
It's quite possible that your connection string is no longer valid since you reinstalled SQL server. Fire up SSMS and see if you don't have a second instance of SQL running on your machine. If you do, that could be causing some of your connection errors.
Just to read up on the error and some other possible solutions, you might want to take a look at SQL SERVER – FIX : ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) on the SQLAuthority.com blog. You might be able to get some more ideas of what your problem is, and possible solutions.
Good luck. I've been there myself and it's a real pain. Hope this helps some.
精彩评论