2011-08-23 73 views
1

您好我有一个应用程序在C#中将数据从远程托管服务器(winhost)下拉以同步到本地sql服务器(复制不是选项)......非常小的数据集10 -100测试我只检索2行。该应用程序在我的开发机器上正常工作。然而,客户端网络上,我得到一个间歇性的错误说有一半的时间:到远程服务器的SQL连接错误

Error Occurred Getting Record From Remote Server: Details => System.Data.SqlClient.SqlException (0x80131904): 
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) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, 
Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()  At 
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, 
Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) 
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) at 
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, 
Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, 
TimeoutTimer timeout) at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection 
owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUser 
Instance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString 
connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) 
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object 
poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) at System.Data.ProviderBase. 
DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) 
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) 
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) 
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) 
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) 
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, 
DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at 
System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) at AfocImport.Program.Main(String[] args) 

在我的机器我有20 MB/s下降和应用程序的工作原理没有问题,从来没遇到过这种错误,但是客户端是T1 1.5MB/s下。我假设这是问题,但它也可能是客户端网络上的东西(防火墙我检查)...

所以我的问题是这个错误只是表示连接超时,或者可能是别的东西?如果是这样,我能做些什么来纠正这种情况(不幸的是,这是客户唯一可用的互联网)。我试图搞乱连接超时,但这似乎没有什么区别。

回答

0

ping/tracert是什么样的?如何尝试使用端口1433上的telnet连接到远程服务器?我的猜测是端口被阻塞或者DNS无法解析。你是否试图通过名称连接到远程服务器?你有没有尝试IP地址?

+0

使用IP而不是服务器名称似乎有帮助,但我认为非常缓慢的互联网连接真的是罪魁祸首......如果我不使用加密它似乎工作得很好...谢谢对于输入, ima必须以此速率向您发送圣诞贺卡 –

+0

如果是这种情况,他们可能需要在加密/性能/升级其连接性之间做出决定。当你说“只有互联网可用”,他们只在一个岛屿或偏远地区只有一个选择?在大多数地区,通常有更好的选择,而不愿意更多地关注资金(但我确实知道那里有*实际上没有选择的情况)。 –

+0

没有它在曼哈顿逗趣,你会认为没有问题。然而,我在这里遇到的一个常见问题是,像Verizon,Time Warner这样的公司不会将他们希望建筑物支付的每座建筑物连接起来,以便您可以在一栋建筑物中安装快速业务功能,然后储存您的卡住正在运行T1或DSL ......由于成本问题,Verizon已经在曼哈顿有效地停止运行光纤,该公司正试图说服时代华纳在有线电视上运行,但现在它看起来惨淡...... –