Solved

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

Posted on 2008-06-09
2
597 Views
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?

Thanks
0
Comment
Question by:oxygen_728
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 250 total points
ID: 21745216
have you checked the StackTrace property of your exception object?
0
 
LVL 5

Assisted Solution

by:thenrich
thenrich earned 250 total points
ID: 21746307
Try

''' You code here

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now