【问题标题】:How to fix "Named Pipes Provider error: 40" When trying to open connection?尝试打开连接时如何修复“命名管道提供程序错误:40”?
【发布时间】:2016-04-17 14:47:02
【问题描述】:

我正在尝试制作一个将查询插入 Oracle 数据库 的按钮。但是当我尝试打开连接错误弹出:

SqlConnection sqlc = new SqlConnection(IssueTracker.Properties.Settings.Default.ConnectionString);
            sqlc.Open();

sqlc.Open(); 中断消息:

Additional information: 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)

我正在使用 Visual Studio 2015 社区并且我已经安装了 ODAC。 我已经处理了其他人的问题,但他们没有帮助。这让我很困惑,因为我可以用数据填充DataGridViewcomboBox。有谁知道我做错了什么?

【问题讨论】:

  • 如果您认为您正在连接到 Oracle,为什么错误消息指的是 SQL Server?您的 ConnectionString 设置为什么?您使用的是哪个驱动程序?
  • 它从connectionString="DATA SOURCE=localhost:1521/XE;PASSWORD=123;PERSIST SECURITY INFO=True;USER ID=BAZE" 设置为IssueTracker.Properties.Settings.Default.ConnectionString 也许更好的问题是,我如何访问Oracle 数据库,甚至如何向其中插入查询?

标签: c# oracle pipe provider named


【解决方案1】:

我做错了,Alex Poole 为我敲响警钟。

要访问 Oracle 数据库,请使用 OleDbConnection conn = new OleDbConnection();

从这个视频中了解到:https://www.youtube.com/watch?v=JkAIiDWF0HE

【讨论】:

    猜你喜欢
    • 2012-04-14
    • 2013-02-18
    • 1970-01-01
    • 2011-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多