平行刷新网格行 [英] Refresh grid rows parallely

查看:64
本文介绍了平行刷新网格行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,



我在我的asp.net应用程序中遇到问题。

我们有一个处理工资的应用程序员工和每个过程大约需要0.5秒才能完成。

如果我们有60个emps,那么执行顺序需要30秒,我们也使用godaddy的共享主机帐户。

问题是如果我们有更多的员工,如果处理时间超过30秒,那么我在客户端收到连接重置错误,我知道问题是脚本超时,我们无法更改它。

为了解决这个问题,我们尝试了很多解决方案但是徒劳无功。

解决方案1:多线程,使用它需要更多时间,我们限制只创建25个线程。

解决方案2:为每个员工网格行使用更新面板调用c#代码,但只执行最后一个请求。

解决方案3:使用java脚本功能刷新更新面板,这样可以正常工作希望和回报值也需要很多时间,因为对于它给出的每个请求请求然后接收响应,所以这些跳跃消耗更多时间并且所有这些都按顺序发生

解决方案4:在会话中保持数据表中的记录然后绑定以后再次连接在30秒后重置



我想要一个解决方案,其中所有处理请求都是异步发送到服务器并且数据是并行或异步接收的。

如果您有解决方案,请回复

Dear All,

I am facing a problem in my asp.net application.
We have an application which process salary of employees and each process takes around 0.5 sec to complete.
If we have 60 emps then it takes 30 secs since the execution is sequential, also we are using a shared hosting account from godaddy.
The problem is if we have more employees and if processing time exceed 30 secs then I receive connection reset error at client side, I know the problem is bcoz of script time out and we cannot change it.
To overcome this problem we tried lot solutions but in vain.
Solution 1 : Multi threading, using it takes more time and we have limitiations of creating just 25 threads.
Solution 2 : using update panel for each employee grid row call c# code, but only the last request gets executed.
Solution 3 : using java script functionality to refresh update panel, this works fine as we wish and returns values also but takes lot of time since for every request request it given and then the response is received so these hops consume more time and all this happens sequentially
Solution 4 : Keeping records in datatable in session and then binding later again connection is reset after 30 secs

I want a solution where all the request for processing is sent to server asynchronously and data received parallely or asynchronously.
Kindly reply if you have a solution

推荐答案

您必须记住,虽然您可以将数据提取到后台并通过后台线程运行它们,但是UI仍将由框架/操作系统控制的单个UI线程刷新。



并行编程可应用于代码中的DB调用或循环等如果您使用的是4.0。



还可以尝试和eplore 任务 [ ^ ](可以使用框架4.5)。
You must remember that while you can take data fetching to the background and run them via background threads, your UI will still be refreshed by the single UI Thread which is controlled by the framework / OS.

Parallel programming can be applied to DB calls or to loops etc in your code provided you are using 4.0.

Also try and eplore the Task class[^] (proivided you use frameworks 4.5).


这篇关于平行刷新网格行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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