none
"A network-related or instance-specific error occurred while establishing a connection to SQL Server" for the projets who execute the query sql

    Question

  • Hello All,

    Since the last week, i found a problem that nearly all the projets (asp.net and workflow for dynamics CRM 4) doesnt work, they have the same message "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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) ", and also error 40 displayed in certain web application.

    I have checked the related article on the net and i dont think it is the problome about the connection string and configuration of sql server, because the sql server can be connected via sql management studio.
    what's more, i have debug one of them (projet asp.net) in  visual studio and it works but when i complied this projet and deployed this on the IIS(the web.config is OK), it still has the error massage as show before.
    And then i think maybe it is the problome of IIS, but the strand things is that there is another projet asp.net who user the same website and application pool as the other projets asp.net, sometimes it works and sometimes not.
    I also verfied the registe (oledbtimeout and extension timeout) of the CRM server and the trace logs of CRM, but i cant find the solution.

    Thanks so much if anyone can give me some ideas.

    Tuesday, May 22, 2012 9:08 AM

Answers

All replies

  • Hello,

    As english is not my mother tongue, i am not sure to have understood your problem in a full way.

    A maybe stupid question : from when your problem has occured ? It seems that's from a week. Have you modified something since the last week ? Have you installed service packs or security updates  ( maybe , you have new updates installed "silently" by Windows , like the last security updates that were installed on Monday for me ).

    I have a "special" policy about Windows updates on my computer(s). On my own computer ( XP SP3 32-bit ), i am waiting for the Microsoft notifications for updates and i am installing by myself these updates after having checked whether there is a potential problem. On the Windows 7 SP1 of my younger son where i have installed SQL Server 2008 R2 Express (SP1) , the install is done in an automatic way during the night , but i check every morning if an install has been done correctly and i compare with the new proposed updates on my own computer ( Monday, the install has eschewed and i have had to redo it ). It is why i ask this question.

    I have checked that i am able to connect frommy own computer to the no-named SQL Server 2008 R2 SP1 on the computer of my son. I have not tested for the remote named instance ( the same as the no-named one except the name of course )

    But i am not using IIS ( which one for yours ? ) idem for dynamics CRM 4 . I will do some researchesabout these products and i will posts my results.

    Please, could you check whether updates have been installed recently for these products?

    Please, could you give the version and edition of your SQL Server , for the operating systems for the computers ? These informations could be useful.

    Have a nice day

    PS : a stupid question : you have checked the oledbtimeout value. Why are you using OLEDB ( maybe because Dynamics CRM 4 ) ?


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

    Tuesday, May 22, 2012 8:10 PM
    Moderator
  • Hello,

    I have forgotten to provide an old link related to the error 26 , but i am sure that you know it

    http://blogs.msdn.com/b/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx 

    Have a nice day


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

    Tuesday, May 22, 2012 8:14 PM
    Moderator
  • Hello all,

    Sorry for that i havent review this post recently.

    I have checked the oledbtimeout, it is OK. for the update or modification, i demande my colleague and they said to me there isnt

    Finally, we created a new virtual machine and install CRM 4 from the beginning.

    Thank you Papy Normand,

    and Thank you Bhaskar_mule, i had checked this before i post my question.

    Have a good day to you two !!

    Monday, June 04, 2012 9:55 AM
    • Edited by DevSolvijay Thursday, July 26, 2012 2:59 AM
    Tuesday, July 24, 2012 6:54 AM
  • I had this problem appear seemingly randomly, and I eventually figured out what was happening to my projects. It turns out that Visual Studio 2010 sometimes goes in and automatically inserts a node in the XML of the .proj file, which tells the project where to look for the app.settings file (in the project file system root directory). In my project, I have it in a subfolder, which is specified in the .proj file, but that only works if there is no node saying to look in the root. When VS inserts this node, suddenly it gets a default connection string instead of the one in my app.settings, and the result washes up being this error 26, which doesn't mention what connection string it was trying.

    This (or something related) might or might not be your problem too. In my case, I just need to delete that node in the XML when it regenerates.

    Tuesday, August 14, 2012 1:55 AM
  • This worked for me. Hope it helps someone else to.

    When setting up a connection trough wizard:

    1. in Add Connection window click on Advanced button

    2. Locate Data Source property and delete it.

    this forked for me for some reason :)

    Tuesday, December 18, 2012 1:47 AM
  • Hi,

    I can use ip address and port no in connection string to connect to a named-instance.

    I cant connect to the instance by specifying instance name.

    How do I do it?

    Also I cant browse for the instance in SSMS.

    Thanks

    Tuesday, March 26, 2013 11:28 AM
  • Hi

    I have installed SQL Server 2012 on Windows 8 System. SQL Service Browser is Running. Protocol TCP/IP, Named Pipes and Share memory is enabled. In Windows firewall, I have added Inbound Rules for port 2383 and 1433 and Allow Remote Connection is enabled in SQL Server.

    I am able to connect this from other client machine (OS : Windows 7 or Windows 8, Database : SQL Server 2012). but I am not able to connect from system (OS: Windows Server 2008 R2, Database : SQL Server 2012). I can ping.

    When I connect to  SQL Server, the following error message found by sql server management studio

    TITLE: Connect to Server
    ------------------------------

    Cannot connect to server_name.

    ------------------------------
    ADDITIONAL INFORMATION:

    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) (Microsoft SQL Server, Error: 53)

    Need suggestion

    Thanks

    Abedin

    Monday, July 29, 2013 12:05 PM
  • Hi,

    Check all Pinal's tips to see which one is your scenario.

    http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/

    Opening ports in company network can be solved by network admin.

    If your instance is Clustered, check also Pinal's tip and remember Shared memory is not soported on Cluster.

    http://msdn.microsoft.com/en-us/library/ms143506%28v=sql.90%29.aspx

    Cheers,

    Thursday, August 01, 2013 8:30 PM