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

    Question

  • Hello;

    I have the same problem as others, check the error, the difference is that in SQL Server Configuration Manager i don't have any service running. My PC is 64 bit and the SQL Server Network Configuration(32bit), i think that is the issue, but i dont know how to fix it.

    I reinstalled twice.

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

    Cannot connect to LEOMAR-PC\SQLEXPRESS.

    ------------------------------
    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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476

    ------------------------------
    BUTTONS:

    OK
    ------------------------------



    Friday, August 23, 2013 10:29 PM

Answers

All replies

  • To make sure you can also use services.msc and look for "SQL Server (...)"

    If there is no service by that name, you really do not have SQL Server running on that box.

    If there is, and the status is/is not running, check eventlog for any error messages SQL Server related


    Andreas Wolter | Microsoft Certified Master SQL Server
    Blog: www.insidesql.org/blogs/andreaswolter
    Web: www.andreas-wolter.com

    Saturday, August 24, 2013 9:08 AM
  • Hello;

    I have the same problem as others, check the error, the difference is that in SQL Server Configuration Manager i don't have any service running. My PC is 64 bit and the SQL Server Network Configuration(32bit), i think that is the issue, but i dont know how to fix it.

    Do you see any services listed, started or not?  If you are running Windows 8, make sure you are running the correct version of the Configuration manager as described in http://technet.microsoft.com/en-us/library/ms174212.aspx.  You won't see a SQL Server 2012 instance listed if you are using an older version of the mmc snapin.  If you are running the correct version and don't see the instance listed, that means the SQL Server database engine is not installed as Andreas suggested.


    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

    Saturday, August 24, 2013 12:51 PM
  • There are many reasons of SQL server connectivity issue. But I have setup an small checklist that helps me most of the time to find out the real cause of connectivity issue.

    1. Check SQL services are running

    2. Check SQL Browser service is running

    3. Check remote connections are enabled

    4. Network connectivity between database & application servers by TRACERT command

    5. Check TCP/IP protocol enabled at SQL server

    6. Check talent connectivity – telnet <IP address> <port no on SQL server running>

    7. Check UDP port 1434 is open or not on SQL Server

    8. Check firewall is running or not Check

    9. If firewall running, SQL Server & UDP port must be added in exception in firewall


    Regards,
    Rohit Garg
    (My Blog)
    This posting is provided with no warranties and confers no rights.
    Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

    Saturday, August 24, 2013 2:36 PM
  • Hi  alfredodd,

    First, we need to confirm one thing. You’ve mentioned that” in SQL Server Configuration Manager I don't have any service running”, could you just see the service list but not running or you even can’t find the service list? If it is former one, we could start this service by right click the “SQL Server(MSSQLSERVER)” and select “start” manually. If you even can’t find the any services list under ”SQL Server Service”, it may means you didn’t install it properly.
    Second, please verify that the instance name is correct, if you’ve installed it by default, we could just type the computer name or (local) or “.” In the “Server name” box, else please make sure the instance name is correct.

    Thanks,
    Candy Zhou

    Monday, August 26, 2013 8:57 AM
  • I don´t have any service (running or not) in the service list.
    Monday, August 26, 2013 3:12 PM
  • >I don´t have any service (running or not) in the service list.

    Then you need to download and install SQL Server: Microsoft® SQL Server® 2012 Express

    David


    David http://blogs.msdn.com/b/dbrowne/

    Monday, August 26, 2013 3:17 PM
  • So then obviously you can not connect to it.

    The question then is, why is it not there. When you installed, did it not Show an error?

    You can check the Setup-Log here %programfiles%\Microsoft SQL Server\110\Setup Bootstrap\Log\

    more explained here http://technet.microsoft.com/de-de/library/ms143702.aspx

    Could it maybe be the case, that you only installed SQL Server Management Studio, and not the Service itself? - so check what you actually meant to install.


    Andreas Wolter | Microsoft Certified Master SQL Server
    Blog: www.insidesql.org/blogs/andreaswolter
    Web: www.andreas-wolter.com

    Monday, August 26, 2013 3:17 PM
  • Hello;

    I downloaded the SQL Server setup again and it installed successfully, thanks for your help but i continue have a related error.

    My Problem now is from C#, when i try to access to the SQL Server Database present the error:

    System.Data.SqlClient.SqlException was unhandled
      HResult=-2146232060
      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)
      Source=.Net SqlClient Data Provider
      ErrorCode=-2146232060
      Class=20
      LineNumber=0
      Number=-1
      Server=""
      State=0
      StackTrace:
           at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
           at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
           at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)
           at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
           at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
           at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
           at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions)
           at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
           at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
           at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions userOptions)
           at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions userOptions)
           at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
           at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
           at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
           at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
           at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
           at System.Data.SqlClient.SqlConnection.Open()
           at WindowsFormsApplication1.Form1.CMB_Insert_Click(Object sender, EventArgs e) in C:\Users\Leomar\Desktop\C#\Proyecto Leo Gomas\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 40
           at System.Windows.Forms.Control.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
           at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
           at System.Windows.Forms.Control.WndProc(Message& m)
           at System.Windows.Forms.ButtonBase.WndProc(Message& m)
           at System.Windows.Forms.Button.WndProc(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
           at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.Run(Form mainForm)
           at WindowsFormsApplication1.Program.Main() in C:\Users\Leomar\Desktop\C#\Proyecto Leo Gomas\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:line 18
           at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException:

    Tuesday, August 27, 2013 12:42 PM
  •   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)

    Again, make sure the service is running.  Are you connecting remotely or locally?  In the case of a remote connection, make sure you have enabled remote connections using the SQL Server Configuration utility and restarted the service for the setting to become effective.


    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

    Tuesday, August 27, 2013 1:07 PM
  • Hi  Alfredodd,

    First, please try to use the SQL Server Management Studio to connect the Database Engine and check whether this connection is successful. If not, please refer below article named” steps to troubleshoot SQL connectivity issues” to troubleshoot the issue.
    After connecting to SQL Server via SQL Server Management Studio successfully, let’s check the application connection string, make sure it is valid, and connect to SQL Server via the application again. I have provide some useful articles regarding this issue, please refer to them.

    Steps to troubleshoot SQL connectivity issues
    http://blogs.msdn.com/b/sql_protocols/archive/2008/04/30/steps-to-troubleshoot-connectivity-issues.aspx
    SQL Server connection strings
    http://www.connectionstrings.com/sql-server/
    Database connection with asp.net using c#
    http://infynet.wordpress.com/2010/10/20/database-connection-with-asp-net-and-c-net/

    Thanks,
    Candy Zhou

    Wednesday, August 28, 2013 3:31 AM