从服务器接收结果时发生传输级错误. [英] A Transport-level error has occured when receiving results from the server.

查看:1046
本文介绍了从服务器接收结果时发生传输级错误.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我们有一个VB.NET应用程序和SQL DB.如果用户离开笔记本电脑一段时间,并且笔记本电脑进入睡眠状态并且应用程序保持打开状态,则用户将收到错误消息从服务器接收结果时发生传输级错误". 当他回来并尝试使用该应用程序(为示例运行报告)时,该应用程序又从SQL数据库中提取数据.但是,如果他再次运行该报告,则不会出现错误.

we have a VB.NET application and SQL DB. If the user leaves his laptop for a period of time and if the laptop goes to sleep and the application left open, the user gets an error "A Transport-level error has occured when receiving results from the server" when he comes back and try to use the application (run the report for example) again which pulls data from SQL db. But if he runs the report again, he does not get an error.

在我们的代码中,我们检查连接是否断开或关闭,如果是,我们再次打开sql连接.

In our code, we check if the connection is broken or closed, if so we open the sql connection again.

我们如何解决这个问题?

How can we solve this issue?

If SQLConnection.State = ConnectionState.Broken Then
                SQLConnection.Close()
                InitSQLConnection()
            End If
If SQLConnection.State = ConnectionState.Closed Then
                InitSQLConnection()
            End If


推荐答案

尝试启动SQL Server服务:

You could try to start SQL server service:

转到命令提示符

输入"net start mssqlserver"然后按Enter.

type "net start mssqlserver" then press enter.


这篇关于从服务器接收结果时发生传输级错误.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆