Cannot connect to SQL database with Entityframework but with EF Core it's no problem RRS feed

  • Question

  • A friend of mine is working on student project. He had decided to create it on EntityFramework 6.3. When He creates migrations all is created on Database. In "Server explorer" when connect to local instance also connect to Db and tables. The problem is when He wants to reach table with request and get data. It throws an error: "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: 52- Error Locating Server/Instance Specified)" I tried to create migrations and get data from db with EF Core 3.0 and all is ok. Connection strings are the same , just framework is different. He had an old version of Sql but, he had deleted it and installed SQL 2019. I saw in his "Apps" - "sql 2008 r2". I tried to uninstall it but it threw an error. I don't think this could be a reason but who knows.
    Wednesday, November 13, 2019 10:54 AM

All replies

  • Either the connectionstring is wrong,  or the program is running on another computer and remoter access to the computer is being done that is hosting MS SQL Server. The database being hosted on the computer has not been setup for remote connections.
    Wednesday, November 13, 2019 10:39 PM