-
Dan Harrel
- .NET DataStore
- Monday, 14 July 2025 02:46 PM UTC
I touched on this issue as an "oh by the way" in my prior post:
... however the consequence of this behavior change is now coming to bite me. Therefore, I thought I'd give it it's own thread.
We have recently migrated our .NET Datastore environment from PB2019R3 to PB2025. Our database is SQL Anywhere. SnapDevelop 2019 functionality to generate a model from a datawindow generated SQL Anywhere type "smallint" into C# type "short?". Using PB2025, C# models are generated from datawindows directly from within PB itself (very nice!). However, PB2025 now generates SQL Anywhere "smallint" into C# type "int?".
Our C# Web API that uses the new PB2025 generated model compiles without error - which was encouraging. But we are running into an InvalidCastException on GetItem code such as the following stylized example:
short foo = mydw.GetItem<short>(0, "colnm");
We would now have to change "<short>" to "<int>".
I think we have no choice but to retrofit all such cases. Even if this is "fixed" within PB, we probably wouldn't have it on time.
As a suggestion, you could create a .NET DataStore project setting called something like 'Generate small integers to "short"'.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.