Wednesday, March 7, 2012

Error 40: Using aspnet_regsql

I have been having some trouble. I am new to this and am having issues when I am running aspnet_regsql always getting the error:

System.Web.HttpException: Unable to connect to SQL Server database. --> System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)...

my question is how do I change the default settings to allow it to run?

Regards,
Patrick

From Start: Sql Server 2005 -> Configuration Tools -> Surface Area Configuration

In the app: Surface Area Configurations for Services and Connections -> MSSQL Server -> DataBase Engine -> Remote Connections

|||I was having trouble all night with this. After fooling around with the settings, I could no longer even query the databases with the aspnet_regsql. After some reading I made a change in SQL Server Configuration Manager and in the pipes property I changed it from\\.\pipe\MSSQL$SQLEXPRESS\sql\queryto\\.\pipe\sql\querywhich removed all the previous problems I was having with the error 40 also. Hopefully this helps someone else as well.|||Your solution also worked for me after restarting SQL Server.Wink

No comments:

Post a Comment