Reputation: 2515
I have a list which is filled with a data fetched from DB.
My Code:
Dim lst As New List(Of MyClass)
lst = GetData()
MyClass looks like the following:
Public Class MyClass
Public Overridable Property Id as Integer
Public Overridable Property Questions as String
Public Overridable Property Comments as String
End Class
I am trying to loop the lst
For Each item As String In lst
'Some data manipulation
Next
But I am unable to loop it through using the above code.It throws following error:
Value of Type 'MyClass' cannot be converted to 'String'
Whats arong here? Any Help?
Thanks in advance.
Upvotes: 0
Views: 7982
Reputation: 1072
Try this
For Each item As MyClass In lst
'Some data manipulation
Next
Upvotes: 6