S
S
Sasha Pleshakov2016-10-15 20:55:45
ASP.NET
Sasha Pleshakov, 2016-10-15 20:55:45

Why does an error occur when connecting to SQL server?

Description: An unhandled exception occurred while executing the current web request. Check the stack trace for more information about this error and the code snippet that caused it.
Exception Details: System.Data.SqlClient.SqlException: A network or instance-specific error occurred while establishing a connection to SQL Server. Server not found or unavailable. Make sure the instance name is correct and that remote connections are allowed on SQL Server. (provider: SQL Network Interfaces, error: 50 - A Local Database Runtime error occurred. Unable to create an automatic instance. See the Windows application event log for more information about the error.)

The error occurs even when connecting to a full SQL server.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
JackBoner, 2016-10-15
@JackBoner

So, in fact, all possible reasons have already been described. What else would you like to know.
Check connection string. If SQL Server is installed, then check if the browser is enabled and remote connections are configured.
But most likely the problem is in the connection string.

S
Sergey Wegner, 2018-02-13
@wegners

I found the answer only here
. In short, only changing the Application Pool Identity in LocalSystem helped .
If the server is yours and IIS is in your hands, then there are no problems, but if you host somewhere, then in practice I can’t tell you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question