Quick Tip: Fixing “Could not convert variant of type (Null) into type…”
I often use the XML Data Binding wizard in Delphi. However, it doesn’t seem to have been given a lot of attention from Borland/Inprise/Borland/CodeGear/Embarcadero/Idera. And unfortunately, out of the box what it generates is often error prone, apparently not supporting optional elements/attributes.
When the generated code tries to read an optional element or attribute, you will get a “Could not convert variant of type (Null) into type” exception.
The offending code usually looks like
Delphi开发技巧: 修复XML数据绑定错误: “Could not convert variant of type (Null) into type…”!
最新推荐文章于 2023-08-11 14:27:15 发布