获取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 aSELECT COUNT(*) FROM table
first and store the number of records in a variable.
Then use aTask
orTimer
to call a method that does aSELECT COUNT(*) FROM table
on regular intervals, calculate the number of records and display that.