Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
701 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
After migrations, I try to run the command:
dotnet-ef database update
The following error occurs:
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: TCP Provider, error: 25 - Connection string is not valid
OS: Linux Mint 20.3
In appsettings.Development.json:
"ConnectionStrings": {
"ConexaoPadrao": "Server=localhost\\sqlexpress; Initial Catalog=Agenda; Integrated Security=True"
}
Can someone help me?
Server=localhost\sqlexpress
Localhost? It's a SQL Server, not a webserver. Use the right server name.
I got it with this change:
"ConnectionStrings": {
"ConexaoPadrao": "Server=localhost;Database=Agenda;User Id=sa;Password=YourPassword;"
}
SQL Server on Linux does not support named instances. That's why it worked after you removed the instance name (SQLEXPRESS) from the connection string.