最大值未知时如何显示加载进度栏. [英] How to show load progress bar when maximum values are unknown.

查看:220
本文介绍了最大值未知时如何显示加载进度栏.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< input type ="hidden" id ="gwProxy"></input>< input type ="hidden" id ="jsProxy"önclick="jsCall();" />

<input type="hidden" id="gwProxy"></input><input type="hidden" id="jsProxy" önclick="jsCall();" />

推荐答案

这可能不是最好的方法,但是您可以有一个单独的函数来运行相同的查询并仅返回一个行数,然后在progressBar maxvalue时传递该行数.在此步骤之后,您将sqlreader解析为您的类并在增加进度栏值的同时对各行进行迭代.

This might not be the best way to do it but you could have a seperate function that runs the same query and just returns a row count and then you pass that row count as you progressBar maxvalue.After that step you parse the sqlreader to your class and iterate through the rows while incrementing your progressbar value.

 

您正在运行的查询有多大?为什么不仅仅使用dataAdapter填充一张表,它会一枪并且应该足够快以至于您甚至不需要progressBar?

How large is the query that you are running ? WHy not just fill a table using a dataAdapter that will go one shot and should be fast enough that you don''t even need a progressBar ?

 

如上所述. ..我知道这不是最好的解决方案,但是应该可以正常工作.

As stated above...I know this is not the best solution but it should work fine.

 

亲切的问候.


鉴于最大行数是未知的,不是更好地显示诸如手表或沙漏之类的通用表吗?其他替代方法是,尽管我不知道您将如何适应您的体系结构以显示当前记录数.这将使用户意识到进度(速度),而没有很快达到100%的错误希望.
Given the max number of rows is unknown, isn''t it better to show something more generic, like a watch or hourglass? Other alternate is, though I don''t know how you will fit in your architecture is to show the current record count. That will make user aware of progress (speed) and no false hope of reaching 100% soon.


您好
您有两种选择:

1.如FJD.DEETLEFS所述,您应该执行命令并从数据表中获取总记录,并将其用作最大值

2.连同返回的数据值一起,将总记录数与数据一起传递(就网络负载而言,这成本较低,因为每条记录将具有不必要的3-4字节负载.但是,如果您无法执行其他操作命令从数据库中获取数据之前,最好)

您还可以在后面的代码中使用页面大小x页面数,因为您已绑定到Grid视图.

问候
Hi
You have two options:

1. As FJD.DEETLEFS said, you should execute a command and get the total records from the data table, and use it as the Maximum value

2. Along with your Data values returned, pass the total records count too along with the data (this is little costlier in terms of network load, since each record will have unnecessary 3-4 bytes load. However, if you can not execute other command before getting data from database, this is best)

You can also use the Page size x Page count to in the code behind, since you are binding to the Grid view.

regards


这篇关于最大值未知时如何显示加载进度栏.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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