【发布时间】: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。
我已经处理了其他人的问题,但他们没有帮助。这让我很困惑,因为我可以用数据填充DataGridView 和comboBox。有谁知道我做错了什么?
【问题讨论】:
-
如果您认为您正在连接到 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