We have designed a custom sharepoint site. This site uses a membership provider that I implemented, and the users are stored in our custom application database. These are the steps I follow to reproduce the error:
1. Browse to our site. Select Forms Authentication from the default.aspx selection.
2. Enter in a username from our DB table. This user I have configured as a site collection administrator.
3. Login to the site. The user is authenticated by our membership provider and allowed access (ValidateUser returns true)
4. Browse to a page that attempts to connect to the custom app DB.
5. I get the following error when the page attempts to open a connection to our DB:
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
The code that opens the DB connection is running with SPSecurity.RunWithElevatedPrivileges. Our application pool account has access to the database. My user can connect to the database fine as well as the user that our application pool is running as.
I have validated the connection string that is being used in the debugger, and that is correct.
View Complete Post