A connection was successfully established with the server but then an error

 

在使用EFCore生成数据库的时候,报上面的错误!
解决方法:
加(Encrypt=True;TrustServerCertificate=True;)即可:
 
"ConnectionStrings": {
  "DefaultConnection": "Data Source=LAPTOP;Initial Catalog=DB;persist security info=True;User ID=sa;Pwd=XXXXX;Encrypt=True;TrustServerCertificate=True;"
},
posted @ 2024-01-13 16:29  算盘  阅读(146)  评论(0)    收藏  举报