2014-02-12 35 views
-1

我在我的應用程序中使用SqlHelper。如果使用SQL  服務器作爲數據庫,它工作正常。但它在Oracle中不起作用。如果Oracle是數據庫,我可以在VB.NET中使用SqlHelper類嗎?

它顯示:

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) 

如何解決這個問題呢?

回答

0

您應該使用System.Data.OracleClient庫與.NET中的Oracle數據庫連接。 SQL幫助器專門設計用於SQL Server

0

您需要使用Oracle Data Provider for .NET,因爲SqlHelper僅適用於SQL Server。據我所知,微軟一直推薦使用Oracle的.NET數據提供程序,而不是內置的System.Data.OracleClient。根據我們在這裏的測試,Oracle驅動程序擊敗了微軟的Oracle驅動程序。

相關問題