Date to Integer Conversion Error

Topics: Help & Support
Aug 16, 2014 at 6:46 AM
Let me first say that I find the project to be great and I plan on using it in all my applications for it's features and simplicity of use, however I ran into an error message while using the LicenseTypesSKGL project. I provided exactly what I did with the LicenseTypesSKGL so hopefully you can reproduce the error and provide some advice. All the code looks correct based on the documentation (no typos or anything) so my concern is that this is an error in the library itself. I'm running this project in Visual Studio Ultimate 2013 Update 3. Any guidance or suggestions would be greatly appreciated. Now onto what I did:

I downloaded the LicenseTypesSKGL project to step through the code to better understand how to use the library. As long as the userKey.skgl file is present (whether it is blank or has a license key in it) the project works fine.

However if I rename the file to _userKey.skgl the Form1_Load method ends up calling the generateDemoLicense method. This method runs fine until the line return createADemoKey.doKey(30), which throws an exception that is caught in the Try-Catch block of the Form1_Load method. The exception message is:
Conversion from string \"8/16/2014\" to type 'Integer' is not valid.
The inner exception message is
Input string was not in a correct format.
The stack trace is:
at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
at g.a(Int32 A_0, Boolean[] A_1, String A_2, Int32 A_3)
at SKGL.Generate.doKey(Int32 _timeLeft)
at LicenseTypes.Form1.generateDemoLicense() in c:\Users\Dominick\Desktop\Programming\SKGL\License Types\LicenseTypesSKGL\main.cs:line 160
at LicenseTypes.Form1.Form1_Load(Object sender, EventArgs e) in c:\Users\Dominick\Desktop\Programming\SKGL\License Types\LicenseTypesSKGL\main.cs:line 76
The source is:
Microsoft.VisualBasic
The target site is:
{Int32 ToInteger(System.String)}
Coordinator
Aug 21, 2014 at 8:34 AM
Hi!

Thank you for your question. I was able to reproduce this problem with the SKGL version that was used in the LicenseTypesSKGL project. The problem was caused when the datetime format was not yyyy-MM-dd, as the error suggests.

Solution
Please update to the latest version of SKGL (https://skgl.codeplex.com/releases/view/121143) OR using NuGet.

If the problem would still remain, please let me know!

/Artem