2011-08-23 70 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已經在曼哈頓有效地停止運行光纖,該公司正試圖說服時代華納在有線電視上運行,但現在它看起來慘淡...... –