Last post Aug 18, 2009 03:35 AM by BlueJam
Aug 14, 2009 10:18 AM|derral09|LINK
I am trying to implement this
populating a generic data list with generic method I found and I keep getting the following error.
---- 'System.Converter(Of Object, clsSPF)' is a delegate type and requires a single 'addressof' expression as the only argument to the constructor.
Dim dal As New DAL_SPF()
Dim lstSPFData As List(Of clsSPF)
Dim spfdata As clsSPF = New clsSPF()
lstSPFData = dal.ExecuteGenericList(spfdata).ConvertAll(Of clsSPF)(New Converter(Of Object, clsSPF)(Function(o As Object) DirectCast(o, clsSPF)))
I'm using VS2005 / 2.0. How do I get rid of this error or fix this error? Any help would be great!! Thanks in advance.
Aug 18, 2009 03:35 AM|BlueJam|LINK
Did you run it through a code converter? I think it's tried to produce .NET 3.5 code.
It's the following it's complaining about :-
Function(o As Object) DirectCast(o, clsSPF))
You'll need to pull the cast out into a seperate function and call it with the AddressOf keyword.