2008-10-25 17 views
0

我在使用web.config文件中的連接字符串時出現連接到VistaDB的錯誤。VistaDB連接問題以編程方式使用SQLConnection和ConnectionString

它工作正常使用SQLDataSource後,我指定的ProviderName。在另一頁,我只能連接代碼和

下面是連接字符串代碼:

公共功能的CreateConnection()作爲SqlConnection的 _connectionString = ConfigurationManager.ConnectionStrings( 「的ConnectionString」)的ToString ()返回 新的SqlConnection(_connectionString) 端功能

以下是錯誤:

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

如何解決此錯誤?

+0

我得到相同的錯誤。還沒有弄清楚。 – 2009-03-25 06:26:10

回答

2

您不能將SqlConnection與VistaDB連接字符串一起使用。這是您從SQL Server獲得的錯誤 - 它無法找到該服務器。

改爲使用VistaDBConnection。

相關問題