2016-01-12 37 views
0

我試圖製作一個按鈕,將查詢插入Oracle數據庫。但是,當我嘗試打開連接錯誤彈出:在sqlc.Open();有消息如何解決「命名管道提供程序錯誤:40」嘗試打開連接時?

SqlConnection sqlc = new SqlConnection(IssueTracker.Properties.Settings.Default.ConnectionString); 
      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。有誰知道我做錯了什麼?

+0

爲什麼錯誤信息請參閱SQL服務器,如果你認爲你連接到Oracle?你的ConnectionString設置爲什麼?你在使用哪個驅動程序? –

+0

它從'connectionString =「DATA SOURCE = localhost:1521/XE; PASSWORD = 123; PERSIST SECURITY INFO = True; USER ID = BAZE」'設置爲'IssueTracker.Properties.Settings.Default.ConnectionString''也許更好的問題是,我如何訪問Oracle數據庫,甚至如何向其中插入查詢? – exort

回答

相關問題