Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello, what is the reason for this 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: 50- local database runtime error occurred. error occurred during localdb instance startup: sql server process failed to start.

What I have tried:

sqllocaldb.msi was installed and not working

I hope for a solution, thank you
Posted
Comments
Graeme_Grant 14-Feb-24 23:47pm    
The error message is very specific. Check that you connection string is pointing correctly at the database.
yossef2023 14-Feb-24 23:49pm    
Online. Is there a link to how to solve the problem?

Quote:
Online. Is there a link to how to solve the problem?

Read the message carefully: it says that it either can't find SQL server at the address given in your connection string, or the server is hosted on a different computer which is not configured to allow remote computers to access the DB server.

There is no software cure for that that we can give you: you need to check the actual connection string you are using, then check that server at the other end of it - if it is a web-based server address, then the DB admin for that specific server needs to allow remote connections - which he is unlikely to do as they are generally disabled for security reasons.

We can't help you with that: we have no access to either your code, your connection string, or the remote server!
 
Share this answer
 
Check the refer article and try to use "(localdb)\mssqllocaldb" as the server name for connecting to the LocalDB instance, for example: SQLCoffee - Breaking Changes to LocalDB[^]
C#
<connectionStrings>
  <add name="yourContext" connectionString="Data Source=(localdb)\mssqllocaldb; ...
</connectionStrings>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900