如何利用VB.Net 3.5将对象列表数据生成相应的数据库连接字符串?
- 内容介绍
- 文章标签
- 相关推荐
本文共计221个文字,预计阅读时间需要1分钟。
我想使用Aggregate方法,但显然我弄错了。首先,我得到一个包含我的实体对象的列表 Dim employers As List(Of myEntity)=(New XXXX()).getZZZ(userName, userType)。然后,我认定这将是一种将所有名称放置在字符串中的方法。
我想我应该使用’Aggregate’,但显然我弄错了首先,我得到一个我的实体对象列表
Dim employers As List(Of myEntity) = (New XXXX()).getZZZ(userName, userType)
然后我认为这将是一种将所有名称放在字符串中的方法
Dim names as String = employers.Aggregate(Function(current, [next]) current.Name & " " & [next].Name)
但我收到错误:“无法将类型’lambda表达式’转换为参数类型’System.Func(myEntity,myEntity,myEntity ……)
任何线索?
试试这个:Dim names = String.Join(“”,employer.Select(Function(employer)employer.Name))
本文共计221个文字,预计阅读时间需要1分钟。
我想使用Aggregate方法,但显然我弄错了。首先,我得到一个包含我的实体对象的列表 Dim employers As List(Of myEntity)=(New XXXX()).getZZZ(userName, userType)。然后,我认定这将是一种将所有名称放置在字符串中的方法。
我想我应该使用’Aggregate’,但显然我弄错了首先,我得到一个我的实体对象列表
Dim employers As List(Of myEntity) = (New XXXX()).getZZZ(userName, userType)
然后我认为这将是一种将所有名称放在字符串中的方法
Dim names as String = employers.Aggregate(Function(current, [next]) current.Name & " " & [next].Name)
但我收到错误:“无法将类型’lambda表达式’转换为参数类型’System.Func(myEntity,myEntity,myEntity ……)
任何线索?
试试这个:Dim names = String.Join(“”,employer.Select(Function(employer)employer.Name))

