如何解决在操作完成之前经过的超时时间或服务器没有响应的错误。 [英] How to solve the error the timeout period elapsed prior to completion of the operation or the server is not responding.

查看:279
本文介绍了如何解决在操作完成之前经过的超时时间或服务器没有响应的错误。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将在2到3秒内运行,然后我也会在c#中获得超时时间。我不知道如何解决这个问题,请帮帮我..



我尝试过的事情:



public IEnumerable< bugreportspentity> GetBugReportforGoals(Guid assigneeId,Guid projectId,DateTime?dateFrom,DateTime?dateTo,bool showDetails,Guid companyId)

{

using(var vConn = OpenConnection())

{

var vParams = new DynamicParameters();

vParams.Add(@ DateFrom,dateFrom);

vParams.Add(@ DateTo,dateTo);

vParams.Add(@ ProjectId,projectId);

vParams.Add(@ AssigneeId, assigneeId);

vParams.Add(@ ShowGoalLevel,showDetails);

vParams.Add(@ CompanyId,companyId);



返回vConn.Query< bugreportspentity>(USP_BugReport,vParams,commandType:CommandType.StoredProcedure)

.ToList();

}

}



使用dapper连接数据库

in my proc will be run in 2 to 3 seconds only then also i'm getting time out exeception in c#. i don't knoe how to solve this,please help me..

What I have tried:

public IEnumerable<bugreportspentity> GetBugReportforGoals(Guid assigneeId,Guid projectId, DateTime? dateFrom, DateTime? dateTo, bool showDetails, Guid companyId)
{
using (var vConn = OpenConnection())
{
var vParams = new DynamicParameters();
vParams.Add("@DateFrom", dateFrom);
vParams.Add("@DateTo", dateTo);
vParams.Add("@ProjectId", projectId);
vParams.Add("@AssigneeId", assigneeId);
vParams.Add("@ShowGoalLevel", showDetails);
vParams.Add("@CompanyId", companyId);

return vConn.Query<bugreportspentity>("USP_BugReport", vParams, commandType: CommandType.StoredProcedure)
.ToList();
}
}

using dapper to connect with database

解决方案

我们无法帮助:我们无法访问您的数据,或者 - 可能更重要的是 - 访问您的存储过程。


这就是问题出现的地方:您的SP没有在合理的时间内返回数​​据,因此连接超时。为什么?不知道......从查看SP本身开始,直接在SSMS中使用相同的参数运行它。花费多长时间,并查看它返回的数据量。然后查看SSMS中的执行计划,看看它显示的内容。



对不起 - 但我们不能为你做任何事情!
We can't help: we have no access to your data, or - possibly more importantly - any access to your stored procedure.

And that's where the problem is occuring: your SP is not returning data in a reasonable time so the connection is timing out. Why? No idea ... start by looking at the SP itself, and run it directly in SSMS with the same parameters. Time how long it takes, and look at how much data it returns. Then look at the Execution Plan in SSMS and see what it shows.

Sorry - but we can't do any of that for you!


这篇关于如何解决在操作完成之前经过的超时时间或服务器没有响应的错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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