Cannot connect to .\SQLEXPRESS.

Max 1 Reputation point
2020-12-08T12:06:34.31+00:00

SQL Express (2012-2014-2017 &^2019) is used for storing data from our testers.

Normally, this works all fine, but recently in 2 occasions a "network-related or instance-specific" error occurred. The databases ran fine and no known changes had been made to the systems.

In one of the cases, a few days/ weeks earlier, the PC was added to the network domain (where SMBv1 was required).
After reinstalling the complete SQL (Express Advanced 2014) software, everything worked normally again, but the error kept reoccuring at random interval. After taking the PC out of the domain, the issue never showed again.

Now the problem showed again on a stand-alone system, which was running fine before. (now the 2019 version is installed to see if this solves the problem)

Is there a known way to prevent this, or would there be another way to fix this except reinstalling the complete software?

===================================

Cannot connect to [PC-Name]\SQLEXPRESS.

===================================

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


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


Error Number: -1
Severity: 20
State: 0


Program Location:

at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server)
at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,758 questions
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. Yiğit Alsancak 1 Reputation point
    2022-04-27T14:57:32.457+00:00

    OK, i have solved this problem. pcName\SQLEXPRESS gives an error. I tried typing pcName on its own but it wont connect. So apparently you need to use an escape backslash aswell.
    So type = pcName\SQLEXPRESS and it works. Newbies like me do make mistakes like this. Yes.