As I learn vb.net, I rely on the exception messages my bad code generates to figure out what's going on. Sometimes, though, something is wrong and no exception is raised - instead, the remainding code in the sub doesn't execute and the program continues. This makes it harder for me to debug.

For example, this happens if I try to do a SqlDataReader.Read() against a closed connection.

Now if I wrap the code inside a Try block, I can catch the exception, display the Message and learn something.

What I'm wondering is why some unhandled exceptions pop up a box saying my code has created a problem and others (like in the above example) are simply ignored.

As I'm not sure what other scenerios may behave the same way, I'm wondering if it would be a good idea to wrap every sub inside a try block.

I'm very new at vb.net, and information is appreciated.

Mike