K
Keith Patrick
I have some generic .Net objects that I want to use to populate some
DTS-based COM objects. To keep things clean and simply, I have added
attributes to map the properties between each other rather than set each
property manually. However, I get invalid type errors when I hit some of
the COM enumerations, like DTS.DTSPackagePriorityClass. Is there some way
to dynamically do:
DTS.DTSPackagePriorityClass targVal = (DTS.DTSPackagePriorityClass) 2;
I tried Convert.ChangeType, but it won't work, because apparently,
DTSPackagePriorityClass does not implement IConvertible. I even tried this
(not exactly, as my code is much more generic), but it is syntactially
incorrect:
Int32 sourceVal = 2;
DTS.DTSPackagePriorityClass targVal = sourceVal as targVal.GetType();
DTS-based COM objects. To keep things clean and simply, I have added
attributes to map the properties between each other rather than set each
property manually. However, I get invalid type errors when I hit some of
the COM enumerations, like DTS.DTSPackagePriorityClass. Is there some way
to dynamically do:
DTS.DTSPackagePriorityClass targVal = (DTS.DTSPackagePriorityClass) 2;
I tried Convert.ChangeType, but it won't work, because apparently,
DTSPackagePriorityClass does not implement IConvertible. I even tried this
(not exactly, as my code is much more generic), but it is syntactially
incorrect:
Int32 sourceVal = 2;
DTS.DTSPackagePriorityClass targVal = sourceVal as targVal.GetType();