報錯內容::“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: 40 - Could not open a connection to SQL Server)”
解決方式:打開sql server configuration manager(數據庫配置管理器),如下圖
啟用 TCP/IP 協議,然后重啟sql server 服務,就可以了。
找不到數據庫配置管理器的話可以參照該文章:SQL Server Configuration Manager