Does anyone know what this means. Getting this in C# winforms applications:
Not a legal OleAut date
Definition: An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program's instructions. When an error occurs within a method, the method creates an object and hands it off to the runtime system.
An event that occurs during the execution of a program that disrupts the normal flow of instructions is called an exception. Example: public static void Main ()
The C programming language does not support exception handling nor error handling. It is an additional feature offered by C. In spite of the absence of this feature, there are certain ways to implement error handling in C. Generally, in case of an error, most of the functions either return a null value or -1.
Exceptions provide the means to separate the details of what to do when something out of the ordinary happens from the main logic of a program. In traditional programming, error detection, reporting, and handling often lead to confusing spaghetti code.
It means that somewhere in the program is attempting to convert to or from an OLE Automation Date outside the valid range 1-January-4713 BC to 31-December-9999 AD. It might have slipped through because OLE Automation Dates are represented as a double.
Start by looking for any uses of the methods:
DateTime.FromOADate
DateTime.ToOADate
An OADate is represented as a double value whose value is the number of days from midnight on 30 december 1899 (negative values representing earlier dates).
This exception is thrown when trying to convert a value that is outside the valid range of Ole Automation dates to/from a .NET DateTime value (methods DateTime.FromOADate and DateTime.ToOADate - which are also used implicitly for COM Interop).
I believe to be valid for conversion to an OADate the .NET DateTime value needs to be strictly greater than 01/01/0100.
To convert from OADate to a .NET DateTime value, the double value needs to be strictly greater than -657435 (= 01/01/0100) and strictly less than 2958466.0 (01/01/10000).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With