2008-10-25 59 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。

相关问题