搜索
您的当前位置:首页正文

sql server 连接报错error 40

来源:步旅网

做个简单的记录,造成40 的原因有很多,你的错误并不一定就是我遇到的这种情况.

错误描述:
首先我在使用ssms 工具连接的时候是可以正常连接的,也能对数据库进行操作.
在使用 ef core 连接 Sql Server 时报错:
Microsoft.Data.SqlClient.SqlException (0x80131904): 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception (2): 系统找不到指定的文件。

百度文心千问两个小时,不然自己折腾,直接上解决方法吧

解决方法:

因篇幅问题不能全部显示,请点此查看更多更全内容

Top