有没有办法迭代objectResult?即就像在不指定列名的情况下迭代数据表的所有列和行一样。
我喜欢创建一个通用函数,它将显示对象结果的所有列。那么有可能实现这一目标吗?
Dim queryResults As Data.Objects.ObjectResult = CType(obj, Data.Objects.ObjectResult)
If Not (queryResults Is Nothing) Then
' Create the representation.
Dim result As New Dictionary(Of String, Object)
Dim enumerator As System.Collections.IEnumerator = Nothing
enumerator = DirectCast(queryResults, System.Collections.IEnumerable).GetEnumerator()
' Iterate through the query results.
While enumerator.MoveNext()
''How to get all columns ???
End While
' Dispose the enumerator
DirectCast(enumerator, IDisposable).Dispose()
Return result
End If
Return New Dictionary(Of String, Object)