问题描述
我在后台工作者中有这个代码。 ODA- Oracle数据适配器
ds-数据集,OleCon是ole连接。
在select命令下完成querry需要2分钟。
cancelsynq在这个地方没有工作。
我如何向进度条报告这个。以及我如何取消同步。?请帮助
我尝试过:
如果OleCon.State = ConnectionState.Open然后OleCon.Close()
OleCon.Open()
Dim cmd作为新的OleDbCommand(qry,OleCon)
ODA .SelectCommand = cmd'这里需要太长时间
ODA.Fill(ds,table)
OleCon.Close()< / pre>
结束如果
I have this code inside a background worker. ODA- Oracle Data Adapter
ds- Dataset, OleCon is ole connection.
at select command it takes 2 minutes to complete the querry.
cancelsynq is not working at this place.
how I report this into progress bar.? and how I cancelsync.? Please help
What I have tried:
If OleCon.State = ConnectionState.Open Then OleCon.Close()
OleCon.Open()
Dim cmd As New OleDbCommand(qry, OleCon)
ODA.SelectCommand = cmd 'Here takes too long time
ODA.Fill(ds, table)
OleCon.Close()</pre>
End If
推荐答案
如何查找执行进度。 ?
How to find the execution progress.?
基本上,你不能。
显示进度条意味着你知道查询的工作量,但是你通常只在作业完成后知道它。
Basically, you can't.
Displaying a progress bar imply that you know the amount of work of the query, but you usually know it only once the job is finished.
在select命令下完成querry需要2分钟。
at select command it takes 2 minutes to complete the querry.
如果需要2分钟才能完成,这意味着查询需要大量工作才能完成,很有可能Oracle无法对查询进行优化。
最好的希望是显示查询以查看是否可以将其更改为更快。
[更新]
小心两个DateTimes都没有使用相同的格式。
An TEST_DTTM上的索引肯定会加快查询速度。
If it takes 2 minutes to complete, it imply that the query need a huge work to complete, chances are that the query can't be optimized by Oracle.
Best hope would be to show that query to see if one can change it to be faster.
[Update]
Be careful both DateTimes are not using the same format.
An index on TEST_DTTM would certainly speed up the query.
这篇关于用于查询执行和中止查询的Vb.net进度条。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!