今天遇到个问题,在本地进行代码调试,数据库连接不上。
错误描述:
Error Number:-2146893019,State:0,Class:20
A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - 证书链是由不受信任的颁发机构颁发的。)
解决办法:
直接在“数据库连接字符串最后面”增加证书信任的配置。;TrustServerCertificate=true
;TrustServerCertificate=true
再次尝试连接,问题解决了。