Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Website can't connect to SQL Server, Named Pipes error 40Website can't connect to SQL Server, Named Pipes error 40
Previous
 
Next
New Post
10/4/2015 8:47 PM
 

A month or so ago I took down our company website (built on DotNetNuke 4.0.5). I did so by simply moving the files to a separate section of the hard drive so IIS wasn't pointing at them, then later I put the files back. It's something I've done half a dozen times with not issue, but this time I've been getting the following error when I try to load the website:


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)

And here is the following stack I get:

-------------------------------------------------------------------------------------
[
SqlException (0x80131904): 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)] System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +428 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117 System.Data.SqlClient.SqlConnection.Open() +122 Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.DiscoverSpParameterSet(SqlConnection connection, String spName, Boolean includeReturnValueParameter, Object[] parameterValues) +233 Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSetInternal(SqlConnection connection, String spName, Boolean includeReturnValueParameter) +343 Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSet(String connectionString, String spName, Boolean includeReturnValueParameter) +175 Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSet(String connectionString, String spName) +45 Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, String spName, Object[] parameterValues) +207 DotNetNuke.Services.Log.EventLog.DBLoggingProvider.Data.SqlDataProvider.GetLogTypeConfigInfo() +71 DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.GetLogTypeConfigInfo() +101 DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.GetLogTypeConfigInfoByKey(String LogTypeKey, String LogTypePortalID) +65 DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.AddLog(LogInfo objLogInfo) +75 DotNetNuke.Services.Log.EventLog.LogController.AddLog(LogInfo objLogInfo) +175
-------------------------------------------------------------------------------------

Nothing has changed with our setup since then, so I'm clueless as to why I'm getting this error now. Our current setup is our IIS server is on one machine, and the SQL server in question is set up on another. Named Pipes and TC/IP is enabled (with what looks like default properties) on the SQL server, and as far as I can tell there's no interference.

So any advice? I'm not very familiar with ASP.net, much less DNN, so I'm having a hard time troubleshooting anything. I check the web.config file and everything looks good. There is a SQL instance running on the IIS server, but the problem persists regardless of whether it's running or not.

 
New Post
10/5/2015 2:47 AM
 
has anything been changed in SQL Server setup or any of the two connection strings in web.config (which should be identical)?

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
10/5/2015 12:41 PM
 

Nothing has been changed with the SQL setup. As far as connection strings, I only have. It looks like this:

<!-- Connection String for SQL Server 2005 Express -->
<add name="SiteSqlServer" connectionString="Data Source=ServerName;Initial Catalog=Database;User ID=DotNetNuke;Password=Password" providerName="System.Data.SqlClient" />

Where the italicized words are the appropriate credentials (which I've checked, and are correct). There is a second string that is commented out that starts with <!-- Connection String for SQL Server 2000/2005 --->

The biggest thing that confuses me is that on very rare occasions, the website will work perfectly fine. Two weeks ago I check it around 9:00am, and it worked for about five minutes. Today I checked it at about the same time, and it worked for two hours or so, but now it's showing the same error. I suppose it's something with our network, since performance is so sporadic?

 
New Post
10/5/2015 1:15 PM
 
if the website works fine sometimes , there must be an issue with your sql server, maybe the transaction log grow too much or the eventlog, sitelog, schedulehistory or search... tables are having too many entries.

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Website can't connect to SQL Server, Named Pipes error 40Website can't connect to SQL Server, Named Pipes error 40


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out