.net - 提供程序:命名管道提供程序,错误:40 - 无法打开与 SQL Server 2012 的连接
问题描述
我收到以下错误:
用户代码未处理 System.Data.SqlClient.SqlException 消息=建立与 SQL Server 的连接时发生与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确以及 SQL Server 是否配置为允许远程连接。(提供者:命名管道提供者,错误:40 - 无法打开与 SQL Server 的连接)。
这是我的代码:
public DataTable GetAll()
{
SqlCommand Command = new SqlCommand("Domain_GetAll", m_Connection);
Command.CommandType = CommandType.StoredProcedure;
SqlDataAdapter DAdpt = new SqlDataAdapter(Command);
DataSet ds = new DataSet();
DAdpt.Fill(ds,"Domain");**error at this location**
return ds.Tables["Domain"];
}
我该如何解决这个错误?
解决方案
推荐阅读
- javascript - 将 TSS 与 Javascript(无 TS)一起使用时,JSX 内在元素上不存在获取属性
- apache-zookeeper - Zookeeper 临时节点创建顺序
- ios - 如何仅在 IOS Swift 中显示您的设备名称?蓝牙 (BLE)
- python - Python:如何读取包含多个嵌套字典的 .py (config) 文件,修改,然后将更新的内容保存到 .py?
- sql - 在午夜之后获取 DateTime 的期间日期 - SQL
- angular - 调用 Web Api 时获取 HttpErrorResponse 错误状态 400
- c++ - 节目结束得太早
- sql - 如何通过行层次结构进行 SQL 查询?
- css - 更改 squarespace 模板中的导航文本?
- google-sheets - 在 Google 表格中将多个 IF 语句组合在一起