SQL server can only connect in Management Studio

Posted on 2014-08-21
Last Modified: 2014-11-26
seems to be a lot on internet about this error, but can't get connection to work
note the error happens on both same and remote server

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) (.Net SqlClient Data Provider)

SQL 2014
database added
both SQL and Windows authentication enabled
both SQL and Windows authentication work in SQL Server Management studio

HOWEVER neither methods (Windows or SQL) works in e.g. Visual studio etc. (either on same or remote LAN Server)
I've tried using IP address and also the domain e.g.

I have Express and Standard SQL installed, not sure if that would be problem

server name:
server name:

correct username/password input

SO, how do I get BOTH SQL Management Studio  AND other programs e.g. Visual studio, ASP.Net to connect..thanks
Question by:rwallacej
    LVL 77

    Expert Comment

    by:David Johnson, CD, MVP
    run sql configuration manager and enable the protocols you want if any changes restart that sql server instance. open port 1433 on the sql server tcp inbound.

    With default names sql express instance will be servername\sqlexpress and standard sql will just be servername.  If you are not in the same domain or on the same machine you must use sa authentication because it needs something to authenticate the username password combination with

    Author Comment

    On SAME server. SSMS connects fine. Client apps or visual studio don't connect
    Instance name is MSSQLSERVER2014
    Please give example of string for this (if instance name must be included)
    I can't think I've seen instance names in connection strings before
    Port 1433 & protocols enabled
    LVL 44

    Expert Comment

    by:Vitor Montalvão
    SQL Server Browser service need to be run for accept remote connections.
    Check if that service is running. If not set it to automatic and start the service.

    Author Comment

    given up on this for now, will try another time

    Author Comment

    turning off the firewall helped and using the x.x.x.x\INSTANCE instead of x.x.x.x helped
    LVL 77

    Accepted Solution

    without an instance name it connects to mssqlserver but your instance name is MSSQLSERVER2014 ergo you need to connect to servername\MSSQLSERVER2014  you can re-enable the firewall if port 1433 and 4022 are open for the local network on the server for inbound tcp

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
    This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now