Home > Ask the Microsoft .Net Development Experts > Visual Basic .NET Questions & Answers > How has error handling been improved in VB.NET?
Ask The Win Development Expert: Questions & Answers
EMAIL THIS

How has error handling been improved in VB.NET?

Tom Barnaby EXPERT RESPONSE FROM: Tom Barnaby

Pose a Question
Other Win Development Categories
Meet all Win Development Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 29 March 2001
I've heard that error handling is much improved in VB.NET. Can you give me specific advantages compared to VB6? Thanks.

>
VB.NET error handling has improved in two aspects: syntactically and functionally.

Syntactically, VB.NET improves error handling with the new Try/Catch/Finally keywords. This replaces the On Error Goto mess we dealt with in VB6. By the way, On Error Goto is still supported, you just cannot mix both that and Try/Catch/Finally within the same procedure.

Much more important however, is VB.NET's functional error handling improvements as implemented by the Exception class. If you are like me, then you have been frustrated with the lack of functionality provided by the VB6 Err object. Most annoying was the fact that it did not provide a stack trace (a history of procedure calls). That is extremely useful when trying to determine the exact execution path which caused the error. In VB.NET, all exceptions derive from the System.Exception type which provides stack trace functionality and much more. If that still is not good enough, you can derive your own custom exception classes from System.Exceptions and extend the functionality as needed.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Visual Basic .NET
Access VB .NET Windows control on client side
Drop down list server control creates error message
Converting floating values to byte form
Datagrid issue: 'onselection' is not populating
Read data from parallel port
What is the use of these constructors?
Give me an ODBC connect, with SQL authentication
Converting EXE-files to VB components
Generating classes like we did in VB6
Manipulating text through VB.NET

VB 6 to VB .NET Migration
On managing a .NET Framework 1.x migration
Tool translates VB .NET code to Java
Microsoft unveils VB 2005 'Power Packs'
Mini-Guide: The VB.NET Development Environment, Part 3
Mini-Guide: The VB.NET Development Environment, Part 2
Mini-Guide: The VB.NET Development Environment, Part 1
Put VB.NET events in the hands of AddHandler
Choosing VB.NET or C# Learning Guide
Object-Oriented Programming in VB .NET Learning Guide
Quiz: What do you know about VB 6 migration?

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
.NET  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Windows Development - White Papers, News and Expert Advice
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts