Exception Handling
0
Exception Handling :
Types
Types of Exception Handling
Structured Exception Handling
StructuredException Handling is included in [Link]
E.g. When we open a file & file not exist, exception raised and
handled by system itself.
Un-structured Exceptional Handling
Un-structured Exceptional Handling of Visual Basic is still
supported in [Link].
Exception class in system namespace is base class
of all Exceptions.
Exception Handling : Error Types
Three types of Errors:
Syntax
Appear when we write the wrong Syntax.
Easily fixed in .NET
Runtime
Appear only when we Compile & Run the code.
Logical
Appear when we use the application, but producing wrong result.
Exception Handling : System Defined
System defined exceptions
are:
Exception
Index Out Of Range Exception
Null Reference Exception
Argument Exception
Arithmetic Exception
Exception Handling :
Syntax
Syntax:
Try
Catch [exception as
type] Catch [exception
as type]
Finally
[finally statement]
End Try
Exception Handling
Example:
User Defined Exception
Example: