Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 ASPNETDB issues

Author  Topic 

Manchonoch
Starting Member

2 Posts

Posted - 2010-03-01 : 07:47:55
I have a site which uses aspnetdb in a custom db. Had to reimage server now I can't seem to reinstall aspnetdb. I believe the wweb.config is still set up same way. The new sql server 2008 express is set the same way. I keep getting an error about named pipes not being on. Named pipes and tcp/ip are both enabled. When I run aspnet_regsql.exe.


Setup Failed

Exception:
Unable to connect to SQL Server database.

----------------------------------------
Details of failure
----------------------------------------

System.Web.HttpException: Unable to connect to SQL Server database. ---> System.Data.SqlClient.SqlException: 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)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString)
--- End of inner exception stack trace ---
at System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString)
at System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install)
at System.Web.Management.SqlServices.Install(String database, SqlFeatures features, String connectionString)
at System.Web.Management.ConfirmPanel.Execute()


Here are my web.config settings relating to this topic:

<connectionStrings>
<!-- Local connection-->

<add name="ConnectionString" connectionString="server=MANCHONOCH-PC\SQLEXPRESS; database=bpmdb;uid=*******;password=********;Trusted_Connection=False" providerName="System.Data.SqlClient"/>


<remove name="LocalSqlServer"/>

<add name="LocalSqlServer" connectionString=" Server=MANCHONOCH-PC\SQLEXPRESS,1433; database=bpmdb; User ID=*******; Password=*******; Trusted_Connection=False" providerName="System.Data.SqlClient"/>

<!-- Production connection
<add name="ConnectionString" connectionString=" Server=***********************; database=bpmdb; User ID=*******; Password=*******; Trusted_Connection=False" providerName="System.Data.SqlClient"/>
-->

</connectionStrings>
<system.web>
<!-- <roleManager enabled="true"/> -->
<roleManager enabled="true" defaultProvider="CustomProvider">
<providers>
<add connectionStringName="ConnectionString" name="CustomProvider" type="System.Web.Security.SqlRoleProvider"/>
</providers>
</roleManager>
<membership defaultProvider="CustomMembershipProvider">
<providers>
<add name="CustomMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ConnectionString"/>
</providers>
</membership>


Any insight would be helpfull. Thank you in advance.

genius123
Starting Member

1 Post

Posted - 2010-03-24 : 11:53:47
I had the same problem. Here is the fix: Type the instance of your server when you run aspnet_regsql.

Example: if your server's name is crab, type crab/<instance>. If you are running sql server express, type crab/sqlexpress.

Hope that helps!
Go to Top of Page
   

- Advertisement -