Dan Mikkelsen

Sometimes in my program, when i run it in visual studio and there is an error, it dont stop and show the debug window. Instead it just exits the sub where the error is and continues.

Is this some function i can set to on/ off



Re: Visual Basic IDE My program dont stop when an error occurs

Ashish Basran

You can go to (menu) Debug>Exceptions>Common Language Runtime Exceptions and check the Thrown checkbox. That should help you.






Re: Visual Basic IDE My program dont stop when an error occurs

Dan Mikkelsen

That one already is checked.. This is really strange





Re: Visual Basic IDE My program dont stop when an error occurs

DMan1

How about ..Tools...Options...Debugging.."break All Processes when one breaks" and from

MyProject..Debug..."Enable Visual Studio hosting process"






Re: Visual Basic IDE My program dont stop when an error occurs

Dan Mikkelsen

They are all checked, so it cant be that



Re: Visual Basic IDE My program dont stop when an error occurs

BlueMikey

What exactly do you mean by "error" and how do you know that one is occurring   Can you show an example in your code of where this happens




Re: Visual Basic IDE My program dont stop when an error occurs

Dan Mikkelsen

The reason i now is that, in my program it was suppodes to do one thing in an opened up form, but instead it just closed the window. I then inserted a break to manually go through the code one line at a time, and i then found the error in an sql command.

But the thing that stroke me with this, was that when it got to the cmd.executenonquery command, it exited the sub (and when the sub was exited the window would close as it should). Normally when i make an error in an sql command the program stops and give me the error and line number in wich the error occurred. Here it just skips all that and exits the sub and the program continues.





Re: Visual Basic IDE My program dont stop when an error occurs

DMan1

Have you tried putting a try catch around the offending lines of code..




Re: Visual Basic IDE My program dont stop when an error occurs

Dan Mikkelsen

Yearh, but that only help my in that specific stuation. The problem is that it is when im coding and debugging that i want the program to stop so that i easily can find any error in my application before i release it. The best way to correct errors is when the program stops and give me a line number and error code..