VB.NET - Exception Catch - What line of code raised the exception?

Posted on 2008-06-09
Medium Priority
Last Modified: 2008-06-10
When an exception is thrown and caught in my program, I'd like to know what line of code threw the exception.

Is there some way to do this?

Question by:oxygen_728
LVL 71

Accepted Solution

Éric Moreau earned 1000 total points
ID: 21745216
have you checked the StackTrace property of your exception object?

Assisted Solution

thenrich earned 1000 total points
ID: 21746307

''' You code here

 Catch ex As Exception
            MsgBox(ex.Message & chr(13) & ex.StackTrace)
End Try

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Watch the video to know the simple way to remove or recover or reset lost or forgotten passwords of Outlook PST file. With Kernel Outlook Password Recovery tool such operation is very easy to perform. It is a freeware with limitation to use with 500…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question