Technology Microsoft Software & solutions

VB Error Handling is Structured!

If the old coder's saying is true: "Good programmers write good code but great programmers steal great code." ... then Microsoft has done a really great job in designing the runtime error handling in VB.NET! The whole idea was pioneered and perfected in languages like C++ and Java. VB.NET has taken the 'best of the best' and made it part of the language. And it works.

Like real estate, there are three things that are most important about coding structured error handling in VB.NET.

  1. Location
  2. Location
  3. Location

In other words, the first thing to think about is where to put the error trapping in your code. Once you decide that, then you write the error handling code to intercept the errors using several different techniques and minimize the effect of bad things happening in your program.

You can use a Try-Catch error handler for ...
  • Hardware
    A server, modem, disk drive or printer experiences an error. Add the Try-Catch block around the statements that access the resource.
  • Software
    If a component isn't installed or is the wrong version. Try-Catch block around where the resource is used.
  • Security
    If the user might not have permission to access a resource, add a Try-Catch block around the statements where the resource is used.

Related posts "Technology : Microsoft Software & solutions"

How to Choose a Picture for a User Account and Start Menu in Windows Vista

Microsoft

How to Add Tracfone to the Start Menu

Microsoft

How to Stop the Reboot on the Blue Screen

Microsoft

How Do I Tell What Version of Windows XP I Am Using?

Microsoft

How to Make a Boot CD for Windows Vista

Microsoft

How to Move a Windows XP Installation

Microsoft

How to Install Ubuntu in VirtualBox

Microsoft

How to Fix a Problem With a System Idle Process

Microsoft

How to Add a VLK to Windows XP Home

Microsoft

Leave a Comment