Base solution for your next web application
Open Closed

Cannot connect to SQL Server #2596


User avatar
0
jholla created

I get this error after running Update-Database. How can I fix this?

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)


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    This might be a connection string problem. Probably Update-Database does not get the connection strinh you want. Can you try it like this ?

    Update-Database -ConnectionStringName "MyConnectionString"
    

    It should gets the startup project's connection string by defualt.