I am upgrading from asp1.1 to 2.0
I use collection classes to sort data (e.g in datagrids etc)
Public
Enum newsFields
title
End Enum
Public Overloads Sub Sort(ByVal sortField As newsFields, ByVal isAscending As Boolean)
Select Case sortField
Case newsFields.title
MyBase.Sort(New TitleComparer)
End Select
If Not isAscending Then
MyBase.Reverse()
End If
End Sub 'Sort
Private NotInheritable Class TitleComparer
Implements IComparer
Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer Implements IComparer.Compare
Dim first As newsFields = CType(x, newsFields)
Dim second As newsFields = CType(y, newsFields)
*********This line throws the warning***********
Return first.title.CompareTo(second.title)
End Function 'Compare
End Class TitleComparer
******************************************
I get a warning - BC42025: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.
How can I get around this?
Any and all help appreciated
Mark