获取ASP.NET Web应用程序中的进程状态 [英] Getting the state of process in ASP.NET web application

查看:94
本文介绍了获取ASP.NET Web应用程序中的进程状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个用于导入Excel工作表并在DB中创建项目的网页。在创建时我必须在进度条中显示项目创建的进度,即假设用户导入具有100条记录的纸张,并且第10条记录正在插入到DB中。我必须在2秒后刷新页面的状态区域并显示以下消息和进度条。



处理100条记录中的10条。



此外,用户可以随时取消导入过程。请帮助我如何获得以下数据: -

1.现在正在处理哪条记录?

2.在取消时,我的导入方法如何知道用户已取消导入?



我在网上使用MVC 5申请。



Hi Everyone,

I have a web page for importing excel sheet and create the items in DB. While creating I have to show the progress of item creation in a progress bar i.e. suppose a user imports sheet having 100 records and 10th record is inserting in to the DB. I have to refresh the status area of page after 2 second and show the following message and progress bar.

Processing 10 out of 100 record.

Also user can Cancel the import process any time. Please help me how will I get the following data:-
1. Which record is in process now?
2. On Cancel, how my import method will know that user has cancelled the import?

I am using MVC 5 in my web application.

Please help me how can I achieve this.





在此先感谢,

Alok ...



我尝试了什么:



请帮助我如何实现这一目标。



Thanks in advance,
Alok...

What I have tried:

Please help me how can I achieve this.

推荐答案

做一个首先选择COUNT(*)FROM table 并将变量记录存储在一个变量中。

然后使用任务或者 Timer 调用一个定期执行 SELECT COUNT(*)FROM table 的方法,计算出的数量记录并显示。
Do a SELECT COUNT(*) FROM table first and store the number of records in a variable.
Then use a Task or Timer to call a method that does a SELECT COUNT(*) FROM table on regular intervals, calculate the number of records and display that.


这篇关于获取ASP.NET Web应用程序中的进程状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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