我正在使用移动设备远程连接到(本地)sql服务器。我注意到,如果我要关闭并从Windows重新打开区域本地连接,那么我手机上的第一个查询将抛出此异常
System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. ---> System.Net.Sockets.SocketException: Connection reset by peer
at System.Net.Sockets.Socket.Receive (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags) [0x00052] in <42e4f9ed857640688cdb6b066b668700>:0
at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x000b4] in <42e4f9ed857640688cdb6b066b668700>:0
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x0010f] in <42e4f9ed857640688cdb6b066b668700>:0
at Mono.Data.Tds.Protocol.TdsComm.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x00000] in <3e568fc5e80d42ed9aadc2158f974953>:0
有时我也会在gettign服务器上关闭连接
这是我的连接字符串。
Data Source = xxx.xxx.xxx.xxx; Initial Catalog = Database; user id = sa; password = 1234;Connection Timeout=5
我的例子是模拟。在许多客户中,有时会导致流量下降或 网络基础架构会发生这种情况。
这是我要输入的sql server日志
08/19/2018 01:25:12,Logon,Unknown,Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]
08/19/2018 01:25:12,Logon,Unknown,Error: 18456<c/> Severity: 14<c/> State: 38.
我该如何解决?