在撰写本文时,使用Windows 10 Pro和VS2015 Pro以及所有更新。在安全模式下运行VS并修复Visual Studio的安装而没有运气。请注意,SSMS和其他应用程序可以随时访问数据库。
可以减少代码以打开SQL数据库连接;
Dim sqlCon As New SqlConnection("Server=server\instance;Database=database;User Id=…;Password=…")
sqlCon.Open()
'Works after reboot as many times as required but fails after build or rebuild!
Console.WriteLine(“Connection Opened”)
sqlCon.Close()
sqlCon.Dispose()
重建后的错误是;
Unhandled Exception: System.Data.SqlClient.SqlException: 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)
答案 0 :(得分:0)
原来我们的IT团队在PC上安装了Bitdefender Endpoint Security Tools。幸运的是,可以直接将合适的防火墙配置文件添加到内部Bitdefender管理服务器中。