I'm Building an asp.net core application using Entity Framework Core on Ubuntu 16.04 desktop. I have SQL Server installed and running. I've run the command "-dotnet ef migrations Initial" successfully. I'm prepared to run "-dotnet ef database update" to allow EF to connect to and create the table in the database but I'm receiving this error on the terminal:
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: TCP Provider, error: 25 - Connection string is not valid)
it's a local DB so I'm thinking I don't need a TCP provider, right? how do I tell EF to connect to SQL server?
Specify your connection string on appsettings.json file
{
"ConnectionStrings": {
"DefaultConnection": "Server=YOUR_SERVER_NAME;Database=DBNAME;User Id=sa;Password=PASSWORD;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
}
}