这是什么类型的错误:Error1表达式是',它不是集合类型 [英] What kind of error is this: Error1 Expression is of type ', which is not a collection type

查看:71
本文介绍了这是什么类型的错误:Error1表达式是',它不是集合类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有下一个程序的问题,当我尝试检索变量recordsCollection中的数据时,我收到此错误:



错误1表达式的类型为'JRI.Systeme.Interfaces.Devices.SpyRf.Records.IRecordsCollection',它不是集合类型



此部分出现的问题:

Hi everybody,

I have a problem with the next programme, when I try to retrieve the data in the variable recordsCollection, i get this error:

Error 1 Expression is of type 'JRI.Systeme.Interfaces.Devices.SpyRf.Records.IRecordsCollection', which is not a collection type

The problem out in this part:

For Each record As JRI.Systeme.Interfaces.Devices.SpyRf.Records.IRecord In recordsCollection



更精确地在recordsCollection中

这是程序:


more precisely in recordsCollection
Here is the program:

Private Sub ButtonDecharger_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles ButtonDecharger.Click


       numSerieSonde = TextBoxNumSerie.Text
       CaptSonde = typeSonde + TextBoxNumSerie.Text
       Dim monitoring As New Monitoring()

       SpyModem.GetSatelliteMeasurementsFromLast(CaptSonde, 1, Data1)

       Dim converter As New JRI.Systeme.Data.SpyRf.Records.RecordsDataToRecordsCollectionConverter(Monitoring)
       Dim recordsCollection As JRI.Systeme.Interfaces.Devices.SpyRf.Records.IRecordsCollection = Converter.convert(Data1)



       For Each record As JRI.Systeme.Interfaces.Devices.SpyRf.Records.IRecord In recordsCollection
           If record.recordType = JRI.Systeme.Interfaces.Devices.SpyRf.Records.RecordType.TrackMeasure Then
               Dim recordMeasure As JRI.Systeme.Interfaces.Devices.SpyRf.Records.IRecordMeasure = TryCast(record, JRI.Systeme.Interfaces.Devices.SpyRf.Records.IRecordMeasure)
               Console.WriteLine("{0} : Mesure {1}", record.dateTime, recordMeasure.measure.intValue / Math.Pow(10, recordMeasure.monitoring.numOfDecimals))
           Else
               Console.WriteLine("{0} : {1}", record.dateTime, record.recordType)
           End If
       Next


   End Sub



有什么问题?

谢谢


What is the problem?
Thanks

推荐答案

它告诉你IRecordsCollection(recordsCollection变量)尽管它的名字不是一个集合,这也意味着For Each不能迭代它。它可能表现得像一个集合,但它不是来自For Each可以迭代的集合类。



我会查找IRecordsCollection的继承链,并确保它派生自一个内置的集合类。这是你写的东西还是别的东西?
Its telling you that the IRecordsCollection (the recordsCollection variable) despite its name is not a collection, which also means that For Each can't iterate through it. It might behave like a collection, but it doesn't derive from a collection class that For Each can iterate through.

I would look up the inheritance chain for the IRecordsCollection and make sure it derives from one of the built in collection classes. Is this something you wrote or something that you got somewhere else?


这篇关于这是什么类型的错误:Error1表达式是',它不是集合类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆