Mam prosty projekt C#. To jest mój ciąg połączenia w moim web.config
dla bazy danych:update-database: "Wystąpił błąd związany z siecią lub wystąpieniem konkretnej instancji podczas nawiązywania połączenia z serwerem SQL"
<connectionStrings>
<add name="DefaultConnection"
connectionString="Data Source=172.17.0.47;Initial Catalog=DevSystemListe;User ID=web_access;Password=123456"
providerName="System.Data.SqlClient" />
</connectionStrings>
mam już pewność, że to połączenie jest aktywne. Mogę połączyć się z bazą danych z Visual Studio za pomocą tego połączenia, a także mogę zobaczyć tabele i dane.
Kiedy chcę zaktualizować bazę danych z update-database
występuje ten błąd:
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: 26 - Error Locating Server/Instance Specified)
odinstalowałem Entity Framework, a następnie zainstalować go ponownie. Nic się nie zmieniło.
Serwer SQL jest powiązany z domyślnym portem (1433)? – fishmong3r
@ fishmong3r Tak jest. – Anaa
Jak nazywa się ciąg połączenia, który przekazałeś do konstruktora klasy 'DbContext'? –