Hi all, I’ve got a VB.net Windows Forms Application. At startup, I retrieve data from SQL server, enable a timer that checks for an Internet connection then opens the Main Screen. My problem: The application freezes up at different points and sometimes not at all. I’m at a complete loss! I’ve turned the timer off, still happens. The only thing I haven’t turned off is getting data from SQL Server. Has anyone had this kind of problem before? I hope so - any help would be appreciated. Thanks in advance! Kevin

I get sarcastic after a long day… ={
Could you post the code you have in your Form_load event?
And if you have any Settings could you post those?
Do you have any code on any events prior to the load event? If so could you post that code as well?

John - the timeout is set to 15 seconds.

Is there a long query in your code?
If so try to use async methods.
And as a good friend indicated, each time you have a long operation taking place call Application.DoEvents() that enable the windows scheduler to process messages (events).

Cheers

Sherwood - no. It usually freezes up before the user has a chance to do anything. Other times, it freezes right after they choose an option on the main menu.

I wish that I knew enough to give you the right information that you need. But being new to VB.net, I’m not sure what that information is.

Thanks for your help!

Kevin

135 - again my apologies. I’ve got try catch blocks around everything that I do. Nothing happens until the form us up. I put breaks in, in every step of the application start up. Nothing freezes when I have the breaks in. It’s only after the form is up.

Thanks anyway, guys.

Kevin

Kevin,

Have you checked the timeout on your Sql Server connection? I believe the default is 30 seconds but if yours is
longer it could give the impression of hanging.

Regards,

John

========================================
Message Received: Jan 11 2011, 09:15 PM

Are you doing any validation as the user inputs data?

John, my apologies.

It’s SQL Server Express on the same machine, I am not data binding. The query is a basic Select query.

Sherwood, I’m not multi-threading(at this point). The freeze occurs at different times when the app is waiting for user input.

In debug mode, I do get quite a few -
The thread ‘Win32 Thread’ (xxxx) has exited with code 0 (0x0).

Again, John and Sherwood, I’m an old VB6 guy and VB.net is still new, so I’m really not sure what more info I can give.

Thanks for your help!

Kevin

I know you think you were very detailed with your post but you were not. I agree with John and I think it is gremlins.
I will take a guess and venture this:
If sometimes happens and sometimes not, could it be your query then? Could it be when it freezes you have a ‘bad’ query that can’t return data? If you have good error trapping setup you should get to the bottom of your issue faster.

I would bet you are running your application single threaded. When long
queries run, or other processes on the server cause your given connection to
wait for a response, you get this “freezing” effect. You can get around this
by spawning you queries on secondary threads (multi-threading).

Take a look at http://www.programmersheaven.com/2/Les_VBNET_14_p1 to get
some ideas of what you need to do.

With all we have to go on, I’d say ghosts.

Is SQL Server on the same machine? what is the query like, are you data binding?

John Warner