>>
Home

>>
All About Me

>>
Books

>>
Events

>>
Links

>>
Photo Gallery

>>
Downloads

>>
Visual Basic .Net

>>
SE IERP

>>
FPU

>>
My Tubes



Login
Register

All content is the property of TimKey.Net unless noted otherwise in the content. All rights reserved




Catch an error in VB.Net

Posted by on Tuesday, November 09, 2004 (CST)

The error handlers of VB6 are now gone. Introducing the new and improved Try - Catch

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


        'To Trap an error use the Try - Catch
        Try
            'Put your code here that you want to try
            'This will stop your application from shutting down
            'if a problem comes up.

        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

 

End Sub

 

'With a small amount of work, you can use more defined types of catch errors and apply different messages that will make more sense to you instead of the standard exception has occurred.  You can have as many catch lines as you want for each kind of error.


Add Your Comment



Financial Peace

Here is a test to find out whether your mission in life is complete. If you're alive, it isn't.
--- Richard Bach

 

New Books

  • Enchanters' End Game
    Publishers Weekly
    "Absorbing. Touches all the right Fantasy bases. Warring gods, political intrigues, supernatural creatures, and appealingly human magicians."


  • The Misanthrope and Tartuffe
    Two classic plays translated by a Pulitzer Prize-winning poet into English verse. Introductions by Richard Wilbur.



  • Castle of Wizardry
    This is like Bonanza, or like I Love Lucy. There will be other fantasy series, but there can never be another that's so seminal, that so captures the essence of fantasy. Big Dave and Little Leigh grow their heroes from the ground up, and they grow the best.

  •  

    New Links

  • Kids and Guns
    My Daughter getting shooting lessons from my Dad. She should listen better...

  • QuickVerse Starter 2005
    Free KJV Bible for your PC. This is the best PC Bible software I have found anywhere and believe me I have looked and tested for years.

  • Free Bug Tracking Software
    Get your free version of PR-Tracker

  •  

    New Posts

  • on site visit
    Posted by linda on Friday, November 14, 2008 (CST)

  • ERP 5.2 Return Material Authorisation troubleshooting
    Posted by Noreen on Tuesday, August 12, 2008 (CST)

  • ERP 7.2 Buyers Workbench
    Posted by rcanavan on Wednesday, November 28, 2007 (CST)

  •  

    Most Popular Books
  • Loose That Man And Let Him Go
    FROM THE PUBLISHER
    Never in the history of the church has there been a time when God has so urgently stirred the hearts of men to become all He created them to be and accomplish all He created them to accomplish.


  • Why Do Men Have Nipples? Hundreds of Questions You'd Only Ask a Doctor After Your Third Martini
    Is There a Doctor in the House? You will laugh outloud as you read this book. This is one of my favorite books of all time. Told in a very humorous manner but with all seriousness, you will be enlightened about hundreds of areas of life we have al

  • Silent No More
    “Silent No More,” expounds upon the issues of our day, including judicial tyranny, race relations, poverty, homosexuality, Islam, education, and the right to life. Pastor Parsley provides practical action steps to engage readers and motivate them to act.


  • Home   |  All About Me   |  Books   |  Events   |  Links   |  Photo Gallery   |  Downloads   |  Visual Basic .Net   |  SE IERP   |  FPU   |  My Tubes