The weird part is that I did not used to have this problem, but it just started happening.
The following reads from a String-type attribute:
Dim MyAttribute As OSIsoft.AF.Asset.AFAttribute
‘MyAttribute is assigned properly
String1 = MyAttribute.GetValue.ToString
When the attribute is a Table-Lookup (although I see the proper value in AF), it returns:
“System.InvalidCastException: Specified cast is not valid.”
Here's an exaple of one of the Table Lookup calls:
SELECT AmbTemp FROM [Table2] WHERE PlantName = '%..\..\..\Element%'
This lookup is working fine in AF, but the code returns an error.
This just began occurring on a site where they have:
PI System Explorer 2010 R3
AF SDK Version 22.214.171.12431
Any help is appreciated.