Gets and sets a value which specifies the last error that has occurred.
Returns an ErrorCode enumeration value which specifies the last error code.
The LastError property returns the error code associated with the last error that occurred for the current instance of the class. It is important to note that this value only has meaning if the previous method indicates that an error has actually occurred.
It is possible to explicitly clear the last error code by assigning the property to the value ErrorCode.errorNone.
The error code value can be cast to an integer value for display purposes if required. For a description of the error that can be displayed using a message box or some other similar mechanism, get the value of the LastErrorString property.