我已经尝试了几种方法,每次尝试时都会出错。
这是使用带有 asp.net(forms) 和 vb.net 的 .net 3.5。
例子:
Dim _registrations = New List(Of Integer)
Dim regList As String
Dim ListOfReg = _registrations.convertall(Of String)(Function(i As Integer) i.ToString())
regList = String.Join(",", ListOfReg.ToArray())
错误信息:
Overload resolution failed because no Public 'convertall' can be called with these arguments:
'Public Function ConvertAll(Of String)(converter As System.Converter(Of Integer,String)) As System.Collections.Generic.List(Of String)':
Argument matching parameter 'converter' cannot convert from 'VB$AnonymousDelegate_0(Of Integer,String)' to 'Converter(Of Integer,String)'.
其他尝试:
regList = String.Join(",", (_registrations.Select(Function(reg) reg.ToString()).ToArray()))
错误信息:
Public member 'Select' on type 'List(Of Integer)' not found.
任何帮助表示赞赏。
谢谢。