How to display progress of a running query
Posted on 2004-04-27
I am running a query in access database. The query takes about 1 minute to execute. during this time I want to show the user the progress of the query in a progress bar, otherwise the user thinks as the application stopped responding.
Is there any way to do this? please help. I am very new to .NET
the code I am using is
Dim qstr, strWhere, buildings As String
Dim reportDS As New DataTable
Dim dbconnection As New OleDbConnection(connectionString)
Dim Adapter As New OleDbDataAdapter
buildings = GetBuildingSelection()
strWhere = " WHERE (((ACCOUNT) = " + Str(account_no) + ") AND ((BUILDINGNUM) In (" + buildings + ")))"
qstr = "SELECT * FROM qryDisposalCost" + strWhere
Adapter.SelectCommand = New OleDbCommand(qstr, dbconnection)
Adapter.Fill(reportDS) 'This line takes about 1 minute to finish