Hey,

I have the following code in a class that inherits from SortedList.

VB Code:
  1. Public Sub Dispose() Implements System.IDisposable.Dispose
  2.         Dim entry As DictionaryEntry
  3.         For Each entry In MyBase.Values
  4.             CType(entry.Value, Invoice).Dispose()
  5.         Next
  6.     End Sub

The for each entry in mybase.value causes the following error
System.InvalidCastException - Specified cast is not valid.

Does anyone know why this is happening? I thought that Values return a dictionary entry.

Thanks,