Reputation: 1276
I'm new to .Net and haven't coded in Visual Basic in many years. I'm having trouble assigning values to an array and am getting the error, "Value of type MemberFocal.Member cannot be converted to System.Array" - MemberFocal.Member is part of a custom class and I am attempting to create an array of these objects. Any help is greatly appreciated. Here is the code:
Public Function CreateMembersFromDataSet(ByVal memberDs As DataSet) As Array
Dim returnval() As Array
Dim memberTable As DataTableCollection
Dim i As Integer = 0
memberTable = memberDs.Tables
For Each row As DataRow In memberTable
' error occurs on the following line
returnval(i) = Me.CreateMemberWithId(row.Item("id").ToString)
i += 1
Next
Return returnval
End Function
Upvotes: 1
Views: 196
Reputation: 887195
Dim returnval() As Array
creates an array of Array
values.
You want Dim returnval() As Member
.
Upvotes: 4