选择sql查询并显示进度栏? [英] select sql query and show in progress bar?

查看:99
本文介绍了选择sql查询并显示进度栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据库有很多记录.我想选择它,我想在选择记录时在进度栏中显示它,怎么办?

my database have many records .and i want select it , i want show it in progress bar when select records, what do?

推荐答案

要执行此操作,您将必须异步执行选择,同时显示某种指示,表明查询正在进行中.

异步进行填充的一种方法是使用 BackgroundWorker [ ^ ].因此,基本上,您将在DoWork事件中填充数据适配器(或使用的任何对象).

旁注:由于用户通常不太愿意等待很长时间,因此,我会尽最大的努力来提高查询性能,并且将进度指示器用作最后的选择".仅拥有许多记录并不意味着查询会自动变慢.例如,这可能是由于索引不足所致.
In order to do that you would have to execute the select asynchronously and in the meantime show some kind of indication that the query is in progress.

One way to do the fill asynchronously is to use BackgroundWorker [^]. So basically you would put the data adapter fill (or whatever you use) in the DoWork event.

A side note: Since users are typically not very willing to wait for long times I would put most of the effort to enhancing the query performance, if possible and use the progress indicator as ''the last option''. Just having many records doesn''t mean that the queries are automatically slow. That maybe for example because of inadequate indexing.


我不知道您必须做什么,但是您可以查看本文 ^ ]并显示您的查询
I''m not sure what do you have to do, but you could check this article Showing progress bar in a status bar pane[^] and display your query


^ ]可能会有帮助.
This post[^] might help.


这篇关于选择sql查询并显示进度栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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