.NET generates an exception object any time an unexpected condition is encountered. This enables a comprehensive, consistent approach to handling such conditions in any type of .NET module.
An exception object is an instance of a class that derives from a class named System.Exception. A variety of subclasses of System.Exception are available for different circumstances. These subclasses allow condition-specific information about the exception to be exposed.
|HelpLink||A string indicating the link to help for this exception.|
|InnerException||Returns the exception object reference to an inner (nested) exception.|
|Message||A string that contains a description of the error, suitable for displaying to users.|
|Source||The name of the object that generated the error.|
|StackTrace||A read-only property. The stack trace is a list of the method calls at the point at which the exception was detected. That is, if MethodA called MethodB, and an exception occurred in MethodB, then the stack trace would contain both MethodA and MethodB.|
|TargetSite||A read-only string property that holds the method that threw the exception.|
|GetBaseException||Returns the first exception in the chain|
|ToString||Returns the error string, which might include as ...|