Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Handling in vb.net 1

Status
Not open for further replies.

Ajb2528

Technical User
Feb 22, 2002
270
GB
I dont know wether this has been asked before but...

In VB6 you could retrieve the error number and the error description and also the line number where the error occurred. In vb.net I cannot find a way of duplicating this functionality. Has anyone managed to reproduce this or something similar in vb.net?

Any help will be appreciated!

Regards,

Alan
 
You should trap your errors in a Try block, then you can easily get the error details through the error exception such as this:

Try
Code here...
Catch ex As Exception
MessageBox.Show(ex.Message & vbCrLf & ex.StackTrace & vbCrLf & ex.GetType.ToString)
End Try
 
Thanks kliot! I'll try it out next week!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top