Hi All,

I'm running an application in VB.NET 2003 that loads huge amounts of data into a sql server database ( a conversion project)
When the application has run for some time the windows form freezes and displays a (Not Responding) message in the title of the form.
In the mean time the application keeps running normally and is still loading data.
Can any-one please explain why and how this happens and what can be done to prevent it?

Any help is appreciated.

Explore.exe works on a timer, if the dynamic code in the form is static (ie; if it's loading one thing for a while) then explore.exe treats this a non-responsive form.
To prevent: The only way that quickly comes to mind is to do short but effective queries, thus, the form will not be static long enough for Explore.exe to treat it as non-responsive.

Hope this helps, Huzi.

Here's a tip:
Show wait cursor:

Me.Cursor = Cursors.WaitCursor

and after the work is done return it to normal:

Me.Cursor = Cursors.Default

If you have a statusbar in your form you may display text: "Loading..." or something like that.
And the most important thing. If you have some long lasting loop in your code, call

Application.DoEvents()

every once in a while so the message queue won't get "stuck" (prevents Not Responding message).

O good old DoEvents() did the trick. I was already worried that my apps was not doing anything. HItting the F5 key though refreshed the file size in explorer, so something must be going on. I placed some doevents and it works like magic. Kudos.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.