[b]EDIT - Just realised this should probably be in the Developer Forum, so please feel free to move! Sorry!![/b]
Hi all,
I'm using vb.net to code a stats retrieval app. I'm having a problem with casting one of the types used for creating the statistics object for retreiving some stats. I have added 2 web references to the project:
[b]GIS_SessionService
GIS_StatService[/b]
I can login and get a session ID fine. The issue is with code to build the stat. I've copied this code from the c# example in the 7.1 stats sdk developers guide, and tried to modify it to work in vb.net.
In this code within my sub:
[code] Dim statistic As New GIS_StatService.statistic()
statistic.statisticId = "statref1"
Dim objectIdType As New GIS_StatService.objectIdType()
System.Console.WriteLine("Statistic needed for Agent1961")
objectIdType.id = "icstest02"
objectIdType.tenantName = "Resources"
statistic.objectId = objectIdType
'Then build metric data.
Dim metric As New GIS_StatService.metric()
Dim statisticType As New GIS_StatService.statisticType()
'objectType[] ot = new objectType[]{objectType.Agent};
Dim ot As New GIS_StatService.objectType()
statisticType.objectType = ot[/code]
I get this error on the last line, with ot highlighted:
[b]Value of type 'GIS_Connect.GIS_StatService.objectType' cannot be converted to '1-dimensional array of GIS_Connect.GIS_StatService.objectType' [/b]
Any help is greatly appreciated, I must be casting the object 'ot' incorrectly but I'm not sure how to cast it correctly.
Thanks,
Mick