Have you considered changing the mouse pointer to an hourglass since this would be extremely simple to implement:
Me.Cursor = Cursors.WaitCursor ...Do your DB calls here... Me.Cursor = Cursors.Default
However, I would agree that the “spinning wheel” display is probably a bit more user friendly and certainly much more obvious. So first get an animated gif that suits your needs. Then create a form in which there is a window with an image.
After that, you can show the form to the user and work in the background with the database as soon as this completes closing the form.
Another alternative would be to use a moving progress bar, so when it reaches 100%, it moves again cyclically and continues to move until you close it.
EDIT:
One thing that I forgot to mention is that you have to handle exception conditions. Suppose you make the cursor wait, then an error occurs. An exception might bypass code that flushes everything. This leaves the user with the cursor changed and no means to change it.
When I did this, I usually created a one-time WaitCursor class, and then used something like this:
Using myWaitCursor As WaitCursor = New WaitCursor ...do something... End Using
In the WaitCursor class Utility, you will return the default cursor. The same would apply if you took the path of using a form with an image or progress bar.
source share