Hi there,
is it possible to implement a progress bar into a vb form while executing a MySQL query so that the user can see the progress of a query or loading data from server? My query can take up to 1 minute, so users think the program has crashed. A progress bar or status text "Loading data" would be very useful so users can see the query is still running.
How to realize this?
Thank for your help!!
Progress bar while doing a query or loading a table?
You can use ExecutePageReader(...) method to retrieve not the whole dataset but some part of it that begins with given row number and has certain quantity of rows. Count all the records first, then divide the amount of the records on several parts and execute said method for each part incrementing ProgressBar.Value.
-
- Posts: 38
- Joined: Tue 07 Mar 2006 17:13
other visual indicators
Besides a pop-up message, other common visual indicators include:
1) Changing the cursor to a an hourglass or other icon while the query executes
2) Using a status bar message that says something to the effect "query executing, please wait..."
1) Changing the cursor to a an hourglass or other icon while the query executes
2) Using a status bar message that says something to the effect "query executing, please wait..."
John,
I tried this but it doesn't work properly
On start of query I changed a status message to "Query..." but there seems no possibility to catch the end of query so I can't change the status message back. You know what I mean? If there would be a feedback from the datatable which indicates that the table is loaded completely I could change the message....
I tried this but it doesn't work properly
On start of query I changed a status message to "Query..." but there seems no possibility to catch the end of query so I can't change the status message back. You know what I mean? If there would be a feedback from the datatable which indicates that the table is loaded completely I could change the message....
Why can't you do the following:
Code: Select all
StatusBar1.Text = "query executing, please wait..."
MySqlDataReader reader = MySqlCommand1.ExecuteReader()
StatusBar1.Text = ""