+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Deployment issue with custom code

Deployment issue with custom code

5 posts, 0 answered
  1. Steven
    Steven avatar
    12 posts
    Registered:
    30 Dec 2009
    23 Mar 2011
    Link to this post
    I have a custom module that accesses the database via the "Sitefinity" connection string.  

    When I point the development server site to the production database the code works correctly. When try to access the module in production 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)



    Thanks
    Steve
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Mar 2011
    Link to this post
    Hi Steven,

    "An error occurred when establishing a connection to the server" - this error is thrown because your SQL server is not accessible - remote connections are not allowed, TCP protocol is not enabled or the SQL service is down. You may find this link useful An error has occurred while establishing a connection to the server. Check this post as well.

    Resolving A network-related or instance-specific error occurred while establishing a connection to SQL Server

    All the best,
    Ivan Dimitrov
    the Telerik team
  3. Steven
    Steven avatar
    12 posts
    Registered:
    30 Dec 2009
    24 Mar 2011
    Link to this post
    The SQL Server is available as it is server the public side of the site.  And it also works successfully from the development site when pointed at the production SQL Server.

    For some reason the only issue is the custom module.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    30 Mar 2011
    Link to this post
    Hello Steven,

    Check the method where you are trying to instantiate the connection to this server. The error says that this server is not accessible. If you put a simple user control that use ASP.NET SqlConnection can you query your database?

    Best wishes,
    Ivan Dimitrov
    the Telerik team
  5. Steven
    Steven avatar
    12 posts
    Registered:
    30 Dec 2009
    01 Apr 2011
    Link to this post
    Hi,  I was able to fix this tonight

    Thanks for you help.

    It was a weird issue, I redeployed the entire site and it started working :(

    Thanks
Register for webinar
5 posts, 0 answered