在执行长查询时显示进度条.... [英] Show Progress Bar....while executing long query

查看:61
本文介绍了在执行长查询时显示进度条....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个sql查询...我在我的c#windows应用程序中执行...使用cmd.executeNonQuery();

和这个cmd.executeNonQuery();查询需要在半分钟或一分钟时间执行....

i希望在屏幕上显示用户....进度条....执行进度....

是可能的...我将如何做...

i have one sql query...which i executes in my c# windows application... using cmd.executeNonQuery();
and this cmd.executeNonQuery(); query takes executes in half or a minute time....
i want to show user on screen....the progress bar....with execution progress....
is that possible...how i will do that...

推荐答案

检查以下文章并在项目中实施。



1. 如何使用c#.net 在Windows应用程序中使用进度条控件[ ^ ]

2. ProgressBar [ ^ ]
Check the following articles and implement in your project.

1. how to use progressbar control in windows application using c#.net[^]
2. ProgressBar[^]


先生,实际上在检索您的数据时,您不能知道需要多长时间(取决于数据库)。但是在填充时你可以这样做

sir, actually at the time of retrieving your data back you can't as it is unknown how much time it will take (depends on database). But at time of filling you can do so like this
Progressbar1.Maximum = Dt.Rows.Count;//Dt is your DataTable
for(int i=0;i<dt.rows.count;i++)>
{
    //Do Work
    Progressbar1.Value = i + 1;
}


这篇关于在执行长查询时显示进度条....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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